Skip to content

Commit 875f407

Browse files
committed
Refactor PHY link management into emac_phy
Consolidates Ethernet link-check logic by removing the separate emac_link_check/emac_link modules and moving platform- and PHY-specific link handling into `emac::phy::link`. The network init/run path now uses the new unified PHY link init/change flow, including timer-driven polling support and centralized PHY address usage (`kAddress`). Also improves PHY startup/status handling (autonegotiation/state checks, reset timing/debug output) and applies broad preprocessor cleanup by replacing many bare `#endif` lines with explicit trailing condition comments for readability and maintainability.
1 parent e04de4b commit 875f407

62 files changed

Lines changed: 647 additions & 879 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib-network/include/apps/ntpclient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232

3333
#if !defined(CONFIG_NTP_CLIENT_POLL_POWER_MIN)
3434
#define CONFIG_NTP_CLIENT_POLL_POWER_MIN 3
35-
#endif
35+
#endif // CONFIG_NTP_CLIENT_POLL_POWER_MIN
3636
#if !defined(CONFIG_NTP_CLIENT_POLL_POWER_MAX)
3737
#define CONFIG_NTP_CLIENT_POLL_POWER_MAX 12
38-
#endif
38+
#endif // CONFIG_NTP_CLIENT_POLL_POWER_MAX
3939

4040
namespace network::apps::ntpclient {
4141
inline constexpr uint32_t kTimeoutSeconds = 3;

lib-network/include/core/ip4/arp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void Input(const struct network::arp::Header*);
3737
void Send(void*, const uint32_t, uint32_t);
3838
#if defined CONFIG_NET_ENABLE_PTP
3939
void SendTimestamp(void*, uint32_t, uint32_t);
40-
#endif
40+
#endif // defined CONFIG_NET_ENABLE_PTP
4141
void AcdProbe(ip4_addr_t ipaddr);
4242
void AcdSendAnnouncement(ip4_addr_t ipaddr);
4343
} // namespace network::arp

lib-network/include/core/netif.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#ifndef NETIF_MAX_HWADDR_LEN
3434
#define NETIF_MAX_HWADDR_LEN 6U
35-
#endif
35+
#endif // NETIF_MAX_HWADDR_LEN
3636

3737
namespace netif {
3838

lib-network/include/core/protocol/arp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#if !defined(PACKED)
3535
#define PACKED __attribute__((packed))
36-
#endif
36+
#endif // PACKED
3737

3838
namespace network::arp {
3939
inline constexpr uint16_t kHwtypeEthernet = 1;

lib-network/include/core/protocol/icmp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#if !defined(PACKED)
3535
#define PACKED __attribute__((packed))
36-
#endif
36+
#endif // PACKED
3737

3838
namespace network::icmp {
3939
struct Type {

lib-network/include/core/protocol/igmp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#if !defined(PACKED)
3535
#define PACKED __attribute__((packed))
36-
#endif
36+
#endif // PACKED
3737

3838
namespace network::igmp {
3939
struct Type {

lib-network/include/core/protocol/ip4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#if !defined(PACKED)
3333
#define PACKED __attribute__((packed))
34-
#endif
34+
#endif // PACKED
3535

3636
namespace network::ip4 {
3737
inline constexpr uint32_t kAddressLength = 4;

lib-network/include/core/protocol/ntp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ inline void SubTime(struct ntp::Time* r, const struct ntp::Time* x, const struct
101101
}
102102
} // namespace ntp
103103

104-
#endif /* CORE_PROTOCOL_NTP_H_ */
104+
#endif // CORE_PROTOCOL_NTP_H_

lib-network/include/core/protocol/tcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#if !defined(PACKED)
3535
#define PACKED __attribute__((packed))
36-
#endif
36+
#endif // PACKED
3737

3838
namespace network::tcp {
3939

lib-network/include/core/protocol/udp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#if !defined(PACKED)
3535
#define PACKED __attribute__((packed))
36-
#endif
36+
#endif // PACKED
3737

3838
namespace network::udp {
3939

0 commit comments

Comments
 (0)