@@ -20,25 +20,25 @@ pub use control::*;
2020/// The frame filtering that the MAC should apply to
2121/// received Ethernet frames.
2222#[ derive( Debug , Clone ) ]
23- pub enum FrameFilteringMode {
23+ pub enum Filter {
2424 /// No frame filtering on any frames.
2525 Promiscuous ,
2626 /// Perform frame filtering based on the provided
2727 /// configuration.
28- Filter ( FrameFiltering ) ,
28+ Filter ( FilterConfig ) ,
2929}
3030
31- impl Default for FrameFilteringMode {
31+ impl Default for Filter {
3232 fn default ( ) -> Self {
3333 Self :: Promiscuous
3434 }
3535}
3636
37- impl FrameFilteringMode {
37+ impl Filter {
3838 pub ( crate ) fn configure ( & self , eth_mac : & ETHERNET_MAC ) {
3939 match self {
40- FrameFilteringMode :: Promiscuous => eth_mac. macffr . write ( |w| w. pm ( ) . set_bit ( ) ) ,
41- FrameFilteringMode :: Filter ( config) => config. configure ( eth_mac) ,
40+ Filter :: Promiscuous => eth_mac. macffr . write ( |w| w. pm ( ) . set_bit ( ) ) ,
41+ Filter :: Filter ( config) => config. configure ( eth_mac) ,
4242 }
4343 }
4444}
@@ -49,7 +49,7 @@ impl FrameFilteringMode {
4949/// The total amount of [`MacAddressFilter`]s in this configuration object may
5050/// be at most 3.
5151#[ derive( Debug , Clone ) ]
52- pub struct FrameFiltering {
52+ pub struct FilterConfig {
5353 /// The MAC address of this station. This address is always
5454 /// used for Destination Address filtering.
5555 pub base_address : Mac ,
@@ -59,18 +59,18 @@ pub struct FrameFiltering {
5959
6060 /// Frame filtering applied to frames based on
6161 /// their destination address.
62- pub destination_address_filter : DestinationAddressFiltering ,
62+ pub destination_address_filter : DaFilter ,
6363
6464 /// Frame filtering applied to frames based on
6565 /// their source address.
66- pub source_address_filter : SourceAddressFiltering ,
66+ pub source_address_filter : SaFilter ,
6767
6868 /// Frame filtering applied to frames based on
6969 /// whether they have a multicast address or not.
70- pub multicast_address_filter : MulticastAddressFiltering ,
70+ pub multicast_address_filter : MulticastAddressFilter ,
7171
7272 /// Control frame filtering mode,
73- pub control_filter : ControlFrameFiltering ,
73+ pub control_filter : ControlFrameFilter ,
7474
7575 /// Hash table configuration.
7676 pub hash_table_value : HashTableValue ,
@@ -89,7 +89,7 @@ pub struct FrameFiltering {
8989 pub receive_all : bool ,
9090}
9191
92- impl FrameFiltering {
92+ impl FilterConfig {
9393 /// Create a new basic [`FrameFiltering`] that:
9494 /// * Does not filter out frames destined for `station_addr` or an address
9595 /// contained in `extra_address`.
@@ -115,24 +115,24 @@ impl FrameFiltering {
115115 }
116116 }
117117
118- FrameFiltering {
118+ FilterConfig {
119119 base_address : station_addr,
120120 address_filters,
121- destination_address_filter : DestinationAddressFiltering {
122- perfect_filtering : PerfectDestinationAddressFilteringMode :: Normal ,
121+ destination_address_filter : DaFilter {
122+ perfect_filtering : PerfectDaFilterMode :: Normal ,
123123 hash_table_filtering : false ,
124124 } ,
125- source_address_filter : SourceAddressFiltering :: Ignore ,
126- multicast_address_filter : MulticastAddressFiltering :: PassAll ,
127- control_filter : ControlFrameFiltering :: BlockAll ,
125+ source_address_filter : SaFilter :: Ignore ,
126+ multicast_address_filter : MulticastAddressFilter :: PassAll ,
127+ control_filter : ControlFrameFilter :: BlockAll ,
128128 hash_table_value : HashTableValue :: new ( ) ,
129129 filter_broadcast : false ,
130130 receive_all : false ,
131131 }
132132 }
133133
134134 fn configure ( & self , eth_mac : & ETHERNET_MAC ) {
135- let FrameFiltering {
135+ let FilterConfig {
136136 base_address,
137137 address_filters,
138138 destination_address_filter,
@@ -152,28 +152,28 @@ impl FrameFiltering {
152152 . write ( |w| w. maca0l ( ) . bits ( base_address. low ( ) ) ) ;
153153
154154 let daif = match & destination_address_filter. perfect_filtering {
155- PerfectDestinationAddressFilteringMode :: Normal => false ,
156- PerfectDestinationAddressFilteringMode :: Inverse => true ,
155+ PerfectDaFilterMode :: Normal => false ,
156+ PerfectDaFilterMode :: Inverse => true ,
157157 } ;
158158 let hu = destination_address_filter. hash_table_filtering ;
159159
160160 let ( saf, saif) = match & source_address_filter {
161- SourceAddressFiltering :: Ignore => ( false , false ) ,
162- SourceAddressFiltering :: Normal => ( true , false ) ,
163- SourceAddressFiltering :: Inverse => ( true , true ) ,
161+ SaFilter :: Ignore => ( false , false ) ,
162+ SaFilter :: Normal => ( true , false ) ,
163+ SaFilter :: Inverse => ( true , true ) ,
164164 } ;
165165
166166 let ( pam, hm) = match & multicast_address_filter {
167- MulticastAddressFiltering :: PassAll => ( true , false ) ,
168- MulticastAddressFiltering :: DestinationAddressHash => ( false , true ) ,
169- MulticastAddressFiltering :: DestinationAddress => ( false , false ) ,
167+ MulticastAddressFilter :: PassAll => ( true , false ) ,
168+ MulticastAddressFilter :: DestinationAddressHash => ( false , true ) ,
169+ MulticastAddressFilter :: DestinationAddress => ( false , false ) ,
170170 } ;
171171
172172 let pcf = match & control_filter {
173- ControlFrameFiltering :: BlockAll => 0b00 ,
174- ControlFrameFiltering :: NoPause => 0b01 ,
175- ControlFrameFiltering :: AllowAll => 0b10 ,
176- ControlFrameFiltering :: AddressFilter => 0b11 ,
173+ ControlFrameFilter :: BlockAll => 0b00 ,
174+ ControlFrameFilter :: NoPause => 0b01 ,
175+ ControlFrameFilter :: AllowAll => 0b10 ,
176+ ControlFrameFilter :: AddressFilter => 0b11 ,
177177 } ;
178178
179179 macro_rules! next_addr_reg {
0 commit comments