Commit Graph

15 Commits (88256dbdcfc3b284f5533e5aa2969bf5061db22a)

Author SHA1 Message Date
Dario Nieuwenhuis 88256dbdcf Update to Rust 2018. Fixes #271 2020-12-27 17:54:56 +01:00
jhwgh1968 9f2febcaea Allow mutation of data buffer in RxToken
Closes: #294
Approved by: whitequark
2019-05-05 03:48:25 +08:00
whitequark bbc526fcd6 Fix rust-1.28 feature name (should be rust_1.28). 2018-10-29 07:05:49 +00:00
whitequark 2b7a25b1e2 Add an ARTIQ-specific cargo feature "rust-1.28".
This cargo feature only exists because (a) ARTIQ uses a fork of Rust,
(b) Rust has some ridiculous renaming going on in the alloc crate,
(c) smoltcp exists because of ARTIQ.

Such features will not be ordinarily provided by smoltcp.
2018-08-10 14:53:28 +00:00
whitequark 125a102b71 Update to track changes in liballoc. 2018-07-11 01:57:56 +00:00
Dan Robertson e0b48caca3 Update phy mod to use new time types
Update everything but the socket types to use the new time types instead
of a basic u64

Closes: #141
Approved by: whitequark
2018-02-16 10:44:03 +08:00
Philipp Oppermann 6a8e21cec0 Redesign the phy::Device trait to avoid Drop impls. 2017-11-03 23:15:07 +00:00
Steffen Butzer f9093d15aa phy: introduce hardware based checksum settings, rename DeviceLimits
this contains a rename of occurrences of
DeviceLimits -> DeviceCapabilities.
2017-10-02 21:40:08 +00:00
whitequark 8e13333988 Remove all remnants of the collections feature. 2017-09-22 20:40:13 +00:00
whitequark 8d8a4ea583 Get rid of Result<_, ()>.
The use of this type has several drawbacks:
  * It does not allow distinguishing between different error
    conditions. In fact, we wrongly conflated some of them
    before this commit.
  * It does not allow propagation via ? and requires manual use
    of map_err, which is especially tiresome for downstream code.
  * It prevents us from expanding the set of error conditions
    even if right now we have only one.
  * It prevents us from blanket using Result<T> everywhere
    (a nitpick at most).

Instead, use Result<T, Error> everywhere, and differentiate error
conditions where applicable.
2017-07-27 13:55:47 +00:00
whitequark 250a84e513 Implement a Device that emits a stream in libpcap format. 2017-07-23 14:56:24 +00:00
whitequark b97cacd521 Inject the current timestamp into Device::{transmit,receive}.
Various parts of smoltcp require an arrow of time; a monotonically
increasing timestamp. Most obviously this is TCP sockets, but
the tracer and the pcap writer devices also benefit from having
timestamps. There are a few ways this could be implemented:
  1. using a static Cell, global for the entire smoltcp crate;
  2. using a static method on Device;
  3. using an instance method on Device;
  4. passing the current timestamp into *Interface::poll.

The first two options are undesirable because they create a notion
of global clock, and interfere e.g. with mocking.
The third option is undesirable because not all devices are
inherently tied to a particular clock, e.g. a loopback device isn't.

Therefore, the timestamp is injected into both sockets and devices
through the *Interface::poll method.
2017-07-23 09:48:14 +00:00
whitequark 312ff93c86 Remove default impl for Device::limits().
We should not assume any default MTU.
2017-07-14 03:18:11 +00:00
whitequark f3e54966fd LoopbackInterface → Loopback. 2017-07-14 01:17:06 +00:00
whitequark 63ab7d4e7a Implement loopback interfaces.
This also adds a default implementation of Device::limits.
2017-07-14 01:14:40 +00:00