diff options
| author | Mathias <[email protected]> | 2022-09-27 05:51:14 +0200 |
|---|---|---|
| committer | Mathias <[email protected]> | 2022-09-27 05:51:14 +0200 |
| commit | cd539ba3a0140311dc24930b29877485347fcdd1 (patch) | |
| tree | d413a30b4bb68ab17571ba4d16a613e3859f6335 /embassy-net/src | |
| parent | b743d9f48ce7635b720119336c1a711269f304ed (diff) | |
| parent | c863acd24f6430950a7fdb5c527b33b42c305fec (diff) | |
Rebase
Diffstat (limited to 'embassy-net/src')
| -rw-r--r-- | embassy-net/src/lib.rs | 2 | ||||
| -rw-r--r-- | embassy-net/src/stack.rs | 3 | ||||
| -rw-r--r-- | embassy-net/src/tcp.rs | 6 | ||||
| -rw-r--r-- | embassy-net/src/udp.rs | 2 |
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. |
| 5 | pub(crate) mod fmt; | 5 | pub(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 @@ | |||
| 1 | use core::cell::UnsafeCell; | 1 | use core::cell::UnsafeCell; |
| 2 | use core::future::Future; | 2 | use core::future::{poll_fn, Future}; |
| 3 | use core::task::{Context, Poll}; | 3 | use core::task::{Context, Poll}; |
| 4 | 4 | ||
| 5 | use embassy_sync::waitqueue::WakerRegistration; | 5 | use embassy_sync::waitqueue::WakerRegistration; |
| 6 | use embassy_time::{Instant, Timer}; | 6 | use embassy_time::{Instant, Timer}; |
| 7 | use futures::future::poll_fn; | ||
| 8 | use futures::pin_mut; | 7 | use futures::pin_mut; |
| 9 | use heapless::Vec; | 8 | use 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 @@ | |||
| 1 | use core::cell::UnsafeCell; | 1 | use core::cell::UnsafeCell; |
| 2 | use core::future::poll_fn; | ||
| 2 | use core::mem; | 3 | use core::mem; |
| 3 | use core::task::Poll; | 4 | use core::task::Poll; |
| 4 | 5 | ||
| 5 | use futures::future::poll_fn; | ||
| 6 | use smoltcp::iface::{Interface, SocketHandle}; | 6 | use smoltcp::iface::{Interface, SocketHandle}; |
| 7 | use smoltcp::socket::tcp; | 7 | use smoltcp::socket::tcp; |
| 8 | use smoltcp::time::Duration; | 8 | use 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 @@ | |||
| 1 | use core::cell::UnsafeCell; | 1 | use core::cell::UnsafeCell; |
| 2 | use core::future::poll_fn; | ||
| 2 | use core::mem; | 3 | use core::mem; |
| 3 | use core::task::Poll; | 4 | use core::task::Poll; |
| 4 | 5 | ||
| 5 | use futures::future::poll_fn; | ||
| 6 | use smoltcp::iface::{Interface, SocketHandle}; | 6 | use smoltcp::iface::{Interface, SocketHandle}; |
| 7 | use smoltcp::socket::udp::{self, PacketMetadata}; | 7 | use smoltcp::socket::udp::{self, PacketMetadata}; |
| 8 | use smoltcp::wire::{IpEndpoint, IpListenEndpoint}; | 8 | use smoltcp::wire::{IpEndpoint, IpListenEndpoint}; |
