Skip to content

Commit 470a81c

Browse files
author
Johannes Draaijer
committed
Station Management Interface -> Serial Managment Interface
1 parent 411af3c commit 470a81c

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

examples/arp-smoltcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use smoltcp::wire::{
2525
use stm32_eth::{
2626
hal::gpio::{GpioExt, Speed},
2727
hal::rcc::RccExt,
28-
mac::{MdcPin, MdioPin, Smi},
28+
mac::{MdcPin, MdioPin, Smi, SerialManagement},
2929
stm32::{interrupt, CorePeripherals, Peripherals, SYST},
3030
};
3131
use stm32_eth::{EthPins, RingEntry, TxError};

examples/arp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use fugit::RateExtU32;
2020
use stm32_eth::{
2121
hal::gpio::{GpioExt, Speed},
2222
hal::rcc::RccExt,
23-
mac,
23+
mac::{self, SerialManagement},
2424
stm32::{interrupt, CorePeripherals, Peripherals, SYST},
2525
};
2626

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ where
135135
/// This method does not initialise the external PHY.
136136
///
137137
/// The SMI for the external PHY can be accessed through the
138-
/// returned [`EthernetMACWithSmi`], which implements [`mac::StationManagement`].
138+
/// returned [`EthernetMACWithSmi`], which implements [`mac::SerialManagement`].
139139
///
140140
/// # Note
141141
/// - Make sure that the buffers reside in a memory region that is
@@ -176,7 +176,7 @@ where
176176
///
177177
/// This method does not initialise the external PHY. However it does return an
178178
/// [`EthernetMAC`] which implements the
179-
/// [`mac::StationManagement`] trait. This can be used to
179+
/// [`mac::SerialManagement`] trait. This can be used to
180180
/// communicate with the external PHY.
181181
///
182182
/// # Note

src/mac/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl EthernetMAC {
5050
/// Ethernet media access control (MAC) with owned SMI
5151
///
5252
/// This version of the struct owns it's SMI pins,
53-
/// allowing it to be used [`StationManagement`] directly.
53+
/// allowing it to be used [`SerialManagement`] directly.
5454
pub struct EthernetMACWithSmi<MDIO, MDC>
5555
where
5656
MDIO: MdioPin,
@@ -69,7 +69,7 @@ where
6969
/// Create a new EthernetMAC with owned MDIO and MDC pins.
7070
///
7171
/// To interact with a connected Phy, use this struct's impl of
72-
/// [`StationManagement`]
72+
/// [`SerialManagement`]
7373
pub fn new(eth_mac: ETHERNET_MAC, mdio: MDIO, mdc: MDC) -> Self {
7474
Self { eth_mac, mdio, mdc }
7575
}
@@ -87,7 +87,7 @@ where
8787
}
8888
}
8989

90-
impl<MDIO, MDC> StationManagement for EthernetMACWithSmi<MDIO, MDC>
90+
impl<MDIO, MDC> SerialManagement for EthernetMACWithSmi<MDIO, MDC>
9191
where
9292
MDIO: MdioPin,
9393
MDC: MdcPin,

src/mac/smi.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub unsafe trait MdcPin {}
77

88
/// A trait used for implementing access to SMI
99
/// peripherals/functionality
10-
pub trait StationManagement {
10+
pub trait SerialManagement {
1111
/// Read an SMI register
1212
fn read(&self, phy: u8, reg: u8) -> u16;
1313
/// Write an SMI register
@@ -56,20 +56,18 @@ pub(crate) fn smi_read(iar: &MACMIIAR, dr: &MACMIIDR, phy: u8, reg: u8) -> u16 {
5656
dr.read().md().bits()
5757
}
5858

59-
/// Station Management Interface
59+
/// Serial Management Interface
6060
///
6161
/// Borrows [`MACMIIAR`] and [`MACMIIDR`] from (ETHERNET_MAC)[`crate::stm32::ETHERNET_MAC`], and holds a mutable borrow
6262
/// to the SMI pins.
63-
///
64-
/// Provides access to the MIIM implementation exposed by the MCU's MAC API.
6563
pub struct Smi<'eth, 'pins, Mdio, Mdc> {
6664
macmiiar: &'eth MACMIIAR,
6765
macmiidr: &'eth MACMIIDR,
6866
_mdio: &'pins mut Mdio,
6967
_mdc: &'pins mut Mdc,
7068
}
7169

72-
impl<'eth, 'pins, Mdio, Mdc> StationManagement for Smi<'eth, 'pins, Mdio, Mdc>
70+
impl<'eth, 'pins, Mdio, Mdc> SerialManagement for Smi<'eth, 'pins, Mdio, Mdc>
7371
where
7472
Mdio: MdioPin,
7573
Mdc: MdcPin,

src/phy/lan87xxa.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! SMSC LAN87xxA (LAN8742A, LAN8720A) Ethernet PHYs
22
use core::convert::TryFrom;
33

4-
use crate::{mac::StationManagement, LinkSpeed};
4+
use crate::{mac::SerialManagement, LinkSpeed};
55

66
/// SMSC LAN8720A Ethernet PHY
77
pub type LAN8720A<SMI> = LAN87xxA<SMI, false>;
@@ -67,7 +67,7 @@ pub struct LAN87xxA<S, const EXT_WUCSR_CLEAR: bool> {
6767

6868
impl<S, const EXT_WUCSR_CLEAR: bool> LAN87xxA<S, EXT_WUCSR_CLEAR>
6969
where
70-
S: StationManagement,
70+
S: SerialManagement,
7171
{
7272
/// Create a new LAN87XXA based PHY
7373
pub fn new(smi: S, phy_addr: u8) -> Self {
@@ -162,15 +162,15 @@ where
162162
while !self.link_established() {}
163163
}
164164

165-
/// Release the underlying [`StationManagement`]
165+
/// Release the underlying [`SerialManagement`]
166166
pub fn release(self) -> S {
167167
self.smi
168168
}
169169
}
170170

171171
impl<S, const EXT_WUCSR_CLEAR: bool> super::Phy for LAN87xxA<S, EXT_WUCSR_CLEAR>
172172
where
173-
S: StationManagement,
173+
S: SerialManagement,
174174
{
175175
type LinkSpeed = Option<LinkSpeed>;
176176

0 commit comments

Comments
 (0)