aboutsummaryrefslogtreecommitdiff
path: root/embassy-net/src
diff options
context:
space:
mode:
authorMathias <[email protected]>2022-09-27 05:51:14 +0200
committerMathias <[email protected]>2022-09-27 05:51:14 +0200
commitcd539ba3a0140311dc24930b29877485347fcdd1 (patch)
treed413a30b4bb68ab17571ba4d16a613e3859f6335 /embassy-net/src
parentb743d9f48ce7635b720119336c1a711269f304ed (diff)
parentc863acd24f6430950a7fdb5c527b33b42c305fec (diff)
Rebase
Diffstat (limited to 'embassy-net/src')
-rw-r--r--embassy-net/src/lib.rs2
-rw-r--r--embassy-net/src/stack.rs3
-rw-r--r--embassy-net/src/tcp.rs6
-rw-r--r--embassy-net/src/udp.rs2
4 files changed, 6 insertions, 7 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs
index 8eebc798e..4d30550d3 100644
--- a/embassy-net/src/lib.rs
+++ b/embassy-net/src/lib.rs
@@ -1,5 +1,5 @@
1#![cfg_attr(not(feature = "std"), no_std)] 1#![cfg_attr(not(feature = "std"), no_std)]
2#![cfg_attr(feature = "nightly", feature(generic_associated_types, type_alias_impl_trait))] 2#![cfg_attr(feature = "nightly", feature(type_alias_impl_trait))]
3 3
4// This mod MUST go first, so that the others see its macros. 4// This mod MUST go first, so that the others see its macros.
5pub(crate) mod fmt; 5pub(crate) mod fmt;
diff --git a/embassy-net/src/stack.rs b/embassy-net/src/stack.rs
index 8d2dd4bca..3a7610758 100644
--- a/embassy-net/src/stack.rs
+++ b/embassy-net/src/stack.rs
@@ -1,10 +1,9 @@
1use core::cell::UnsafeCell; 1use core::cell::UnsafeCell;
2use core::future::Future; 2use core::future::{poll_fn, Future};
3use core::task::{Context, Poll}; 3use core::task::{Context, Poll};
4 4
5use embassy_sync::waitqueue::WakerRegistration; 5use embassy_sync::waitqueue::WakerRegistration;
6use embassy_time::{Instant, Timer}; 6use embassy_time::{Instant, Timer};
7use futures::future::poll_fn;
8use futures::pin_mut; 7use futures::pin_mut;
9use heapless::Vec; 8use heapless::Vec;
10#[cfg(feature = "dhcpv4")] 9#[cfg(feature = "dhcpv4")]
diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs
index 0fa873602..f8fff3e2d 100644
--- a/embassy-net/src/tcp.rs
+++ b/embassy-net/src/tcp.rs
@@ -1,8 +1,8 @@
1use core::cell::UnsafeCell; 1use core::cell::UnsafeCell;
2use core::future::poll_fn;
2use core::mem; 3use core::mem;
3use core::task::Poll; 4use core::task::Poll;
4 5
5use futures::future::poll_fn;
6use smoltcp::iface::{Interface, SocketHandle}; 6use smoltcp::iface::{Interface, SocketHandle};
7use smoltcp::socket::tcp; 7use smoltcp::socket::tcp;
8use smoltcp::time::Duration; 8use smoltcp::time::Duration;
@@ -103,7 +103,7 @@ impl<'a> TcpSocket<'a> {
103 Err(tcp::ConnectError::Unaddressable) => return Err(ConnectError::NoRoute), 103 Err(tcp::ConnectError::Unaddressable) => return Err(ConnectError::NoRoute),
104 } 104 }
105 105
106 futures::future::poll_fn(|cx| unsafe { 106 poll_fn(|cx| unsafe {
107 self.io.with_mut(|s, _| match s.state() { 107 self.io.with_mut(|s, _| match s.state() {
108 tcp::State::Closed | tcp::State::TimeWait => Poll::Ready(Err(ConnectError::ConnectionReset)), 108 tcp::State::Closed | tcp::State::TimeWait => Poll::Ready(Err(ConnectError::ConnectionReset)),
109 tcp::State::Listen => unreachable!(), 109 tcp::State::Listen => unreachable!(),
@@ -128,7 +128,7 @@ impl<'a> TcpSocket<'a> {
128 Err(tcp::ListenError::Unaddressable) => return Err(AcceptError::InvalidPort), 128 Err(tcp::ListenError::Unaddressable) => return Err(AcceptError::InvalidPort),
129 } 129 }
130 130
131 futures::future::poll_fn(|cx| unsafe { 131 poll_fn(|cx| unsafe {
132 self.io.with_mut(|s, _| match s.state() { 132 self.io.with_mut(|s, _| match s.state() {
133 tcp::State::Listen | tcp::State::SynSent | tcp::State::SynReceived => { 133 tcp::State::Listen | tcp::State::SynSent | tcp::State::SynReceived => {
134 s.register_send_waker(cx.waker()); 134 s.register_send_waker(cx.waker());
diff --git a/embassy-net/src/udp.rs b/embassy-net/src/udp.rs
index 78b09a492..f2e33493c 100644
--- a/embassy-net/src/udp.rs
+++ b/embassy-net/src/udp.rs
@@ -1,8 +1,8 @@
1use core::cell::UnsafeCell; 1use core::cell::UnsafeCell;
2use core::future::poll_fn;
2use core::mem; 3use core::mem;
3use core::task::Poll; 4use core::task::Poll;
4 5
5use futures::future::poll_fn;
6use smoltcp::iface::{Interface, SocketHandle}; 6use smoltcp::iface::{Interface, SocketHandle};
7use smoltcp::socket::udp::{self, PacketMetadata}; 7use smoltcp::socket::udp::{self, PacketMetadata};
8use smoltcp::wire::{IpEndpoint, IpListenEndpoint}; 8use smoltcp::wire::{IpEndpoint, IpListenEndpoint};