@@ -24,14 +24,14 @@ pub const MTU: usize = 1536;
24
24
/// Represents an ethernet device that allows sending and receiving packets.
25
25
///
26
26
/// This struct implements the [smoltcp::phy::Device] trait.
27
- pub struct EthernetDevice < ' d > {
27
+ pub struct EthernetDevice {
28
28
rx : RxDevice ,
29
29
tx : TxDevice ,
30
- ethernet_dma : & ' d mut ETHERNET_DMA ,
30
+ ethernet_dma : ETHERNET_DMA ,
31
31
ethernet_address : EthernetAddress ,
32
32
}
33
33
34
- impl < ' d > EthernetDevice < ' d > {
34
+ impl EthernetDevice {
35
35
/// Creates and initializes a new `EthernetDevice`.
36
36
///
37
37
/// This function takes the following parameters:
@@ -48,12 +48,12 @@ impl<'d> EthernetDevice<'d> {
48
48
rcc : & mut RCC ,
49
49
syscfg : & mut SYSCFG ,
50
50
ethernet_mac : & mut ETHERNET_MAC ,
51
- ethernet_dma : & ' d mut ETHERNET_DMA ,
51
+ mut ethernet_dma : ETHERNET_DMA ,
52
52
ethernet_address : EthernetAddress ,
53
53
) -> Result < Self , PhyError > {
54
54
use byteorder:: { ByteOrder , LittleEndian } ;
55
55
56
- init:: init ( rcc, syscfg, ethernet_mac, ethernet_dma) ?;
56
+ init:: init ( rcc, syscfg, ethernet_mac, & mut ethernet_dma) ?;
57
57
58
58
let rx_device = RxDevice :: new ( rx_config) ?;
59
59
let tx_device = TxDevice :: new ( tx_config) ;
@@ -75,7 +75,7 @@ impl<'d> EthernetDevice<'d> {
75
75
. maca0hr
76
76
. write ( |w| w. maca0h ( ) . bits ( LittleEndian :: read_u16 ( & eth_bytes[ 4 ..] ) ) ) ;
77
77
78
- init:: start ( ethernet_mac, ethernet_dma) ;
78
+ init:: start ( ethernet_mac, & mut ethernet_dma) ;
79
79
Ok ( EthernetDevice {
80
80
rx : rx_device,
81
81
tx : tx_device,
@@ -104,14 +104,14 @@ impl<'d> EthernetDevice<'d> {
104
104
}
105
105
}
106
106
107
- impl < ' d > Drop for EthernetDevice < ' d > {
107
+ impl Drop for EthernetDevice {
108
108
fn drop ( & mut self ) {
109
109
// TODO stop ethernet device and wait for idle
110
110
unimplemented ! ( ) ;
111
111
}
112
112
}
113
113
114
- impl < ' a , ' d > Device < ' a > for EthernetDevice < ' d > {
114
+ impl < ' a > Device < ' a > for EthernetDevice {
115
115
type RxToken = RxToken < ' a > ;
116
116
type TxToken = TxToken < ' a > ;
117
117
0 commit comments