@@ -10,8 +10,32 @@ use super::PacketId;
1010use smoltcp:: phy:: { ChecksumCapabilities , Device , DeviceCapabilities , RxToken , TxToken } ;
1111use smoltcp:: time:: Instant ;
1212
13+ impl < ' rx , ' tx , ' a > Device for & ' a mut EthernetDMA < ' rx , ' tx > {
14+ type RxToken < ' token >
15+ = <EthernetDMA < ' rx , ' tx > as Device >:: RxToken < ' token >
16+ where
17+ Self : ' token ;
18+
19+ type TxToken < ' token >
20+ = <EthernetDMA < ' rx , ' tx > as Device >:: TxToken < ' token >
21+ where
22+ Self : ' token ;
23+
24+ fn receive ( & mut self , timestamp : Instant ) -> Option < ( Self :: RxToken < ' _ > , Self :: TxToken < ' _ > ) > {
25+ <EthernetDMA < ' rx , ' tx > as Device >:: receive ( self , timestamp)
26+ }
27+
28+ fn transmit ( & mut self , timestamp : Instant ) -> Option < Self :: TxToken < ' _ > > {
29+ <EthernetDMA < ' rx , ' tx > as Device >:: transmit ( self , timestamp)
30+ }
31+
32+ fn capabilities ( & self ) -> DeviceCapabilities {
33+ <EthernetDMA < ' rx , ' tx > as Device >:: capabilities ( self )
34+ }
35+ }
36+
1337/// Use this Ethernet driver with [smoltcp](https://github.com/smoltcp-rs/smoltcp)
14- impl < ' a , ' rx , ' tx > Device for & ' a mut EthernetDMA < ' rx , ' tx > {
38+ impl < ' rx , ' tx > Device for EthernetDMA < ' rx , ' tx > {
1539 type RxToken < ' token >
1640 = EthRxToken < ' token , ' rx >
1741 where
0 commit comments