@@ -24,14 +24,14 @@ pub const MTU: usize = 1536;
2424/// Represents an ethernet device that allows sending and receiving packets.
2525///
2626/// This struct implements the [smoltcp::phy::Device] trait.
27- pub struct EthernetDevice < ' d > {
27+ pub struct EthernetDevice {
2828 rx : RxDevice ,
2929 tx : TxDevice ,
30- ethernet_dma : & ' d mut ETHERNET_DMA ,
30+ ethernet_dma : ETHERNET_DMA ,
3131 ethernet_address : EthernetAddress ,
3232}
3333
34- impl < ' d > EthernetDevice < ' d > {
34+ impl EthernetDevice {
3535 /// Creates and initializes a new `EthernetDevice`.
3636 ///
3737 /// This function takes the following parameters:
@@ -48,12 +48,12 @@ impl<'d> EthernetDevice<'d> {
4848 rcc : & mut RCC ,
4949 syscfg : & mut SYSCFG ,
5050 ethernet_mac : & mut ETHERNET_MAC ,
51- ethernet_dma : & ' d mut ETHERNET_DMA ,
51+ mut ethernet_dma : ETHERNET_DMA ,
5252 ethernet_address : EthernetAddress ,
5353 ) -> Result < Self , PhyError > {
5454 use byteorder:: { ByteOrder , LittleEndian } ;
5555
56- init:: init ( rcc, syscfg, ethernet_mac, ethernet_dma) ?;
56+ init:: init ( rcc, syscfg, ethernet_mac, & mut ethernet_dma) ?;
5757
5858 let rx_device = RxDevice :: new ( rx_config) ?;
5959 let tx_device = TxDevice :: new ( tx_config) ;
@@ -75,7 +75,7 @@ impl<'d> EthernetDevice<'d> {
7575 . maca0hr
7676 . write ( |w| w. maca0h ( ) . bits ( LittleEndian :: read_u16 ( & eth_bytes[ 4 ..] ) ) ) ;
7777
78- init:: start ( ethernet_mac, ethernet_dma) ;
78+ init:: start ( ethernet_mac, & mut ethernet_dma) ;
7979 Ok ( EthernetDevice {
8080 rx : rx_device,
8181 tx : tx_device,
@@ -104,14 +104,14 @@ impl<'d> EthernetDevice<'d> {
104104 }
105105}
106106
107- impl < ' d > Drop for EthernetDevice < ' d > {
107+ impl Drop for EthernetDevice {
108108 fn drop ( & mut self ) {
109109 // TODO stop ethernet device and wait for idle
110110 unimplemented ! ( ) ;
111111 }
112112}
113113
114- impl < ' a , ' d > Device < ' a > for EthernetDevice < ' d > {
114+ impl < ' a > Device < ' a > for EthernetDevice {
115115 type RxToken = RxToken < ' a > ;
116116 type TxToken = TxToken < ' a > ;
117117
0 commit comments