net: remove unreachable legacy LED code
The code is guarded by a condition none of the defconfigs meet (that is CONFIG_SYS_FAULT_ECHO_LINK_DOWN and CONFIG_LED_STATUS_RED both enabled), so we can remove the unreachable code sections. When doing that, there's no caller for miiphy_link anymore, so it can be removed. This in turns makes CONFIG_SYS_FAULT_ECHO_LINK_DOWN and CONFIG_SYS_FAULT_MII_ADDR unused so they are removed as well. Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
@@ -523,28 +523,3 @@ int miiphy_is_1000base_x(const char *devname, unsigned char addr)
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYS_FAULT_ECHO_LINK_DOWN
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Determine link status
|
||||
*/
|
||||
int miiphy_link(const char *devname, unsigned char addr)
|
||||
{
|
||||
unsigned short reg;
|
||||
|
||||
/* dummy read; needed to latch some phys */
|
||||
(void)miiphy_read(devname, addr, MII_BMSR, ®);
|
||||
if (miiphy_read(devname, addr, MII_BMSR, ®)) {
|
||||
puts("MII_BMSR read failed, assuming no link\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Determine if a link is active */
|
||||
if ((reg & BMSR_LSTATUS) != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -29,9 +29,6 @@ int miiphy_reset(const char *devname, unsigned char addr);
|
||||
int miiphy_speed(const char *devname, unsigned char addr);
|
||||
int miiphy_duplex(const char *devname, unsigned char addr);
|
||||
int miiphy_is_1000base_x(const char *devname, unsigned char addr);
|
||||
#ifdef CONFIG_SYS_FAULT_ECHO_LINK_DOWN
|
||||
int miiphy_link(const char *devname, unsigned char addr);
|
||||
#endif
|
||||
|
||||
int miiphy_set_current_dev(const char *devname);
|
||||
const char *miiphy_get_current_dev(void);
|
||||
|
||||
11
net/Kconfig
11
net/Kconfig
@@ -53,17 +53,6 @@ config NET_MAXDEFRAG
|
||||
used for reassembly, and thus an upper bound for the size of
|
||||
IP datagrams that can be received.
|
||||
|
||||
config SYS_FAULT_ECHO_LINK_DOWN
|
||||
bool "Echo the inverted Ethernet link state to the fault LED"
|
||||
help
|
||||
Echo the inverted Ethernet link state to the fault LED. Note, if
|
||||
this option is active, then CONFIG_SYS_FAULT_MII_ADDR also needs to
|
||||
be configured.
|
||||
|
||||
config SYS_FAULT_MII_ADDR
|
||||
hex "MII address of the PHY to check for the Ethernet link state"
|
||||
depends on SYS_FAULT_ECHO_LINK_DOWN && LED_STATUS_RED_ENABLE
|
||||
|
||||
config TFTP_WINDOWSIZE
|
||||
int "TFTP window size"
|
||||
default 1
|
||||
|
||||
35
net/net.c
35
net/net.c
@@ -88,15 +88,9 @@
|
||||
#include <image.h>
|
||||
#include <led.h>
|
||||
#include <log.h>
|
||||
#if defined(CONFIG_LED_STATUS)
|
||||
#include <miiphy.h>
|
||||
#endif
|
||||
#include <net.h>
|
||||
#include <net6.h>
|
||||
#include <ndisc.h>
|
||||
#if defined(CONFIG_LED_STATUS)
|
||||
#include <status_led.h>
|
||||
#endif
|
||||
#include <watchdog.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <net/fastboot_udp.h>
|
||||
@@ -615,19 +609,6 @@ restart:
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
|
||||
#if defined(CONFIG_SYS_FAULT_ECHO_LINK_DOWN) && \
|
||||
defined(CONFIG_LED_STATUS) && \
|
||||
defined(CONFIG_LED_STATUS_RED)
|
||||
/*
|
||||
* Echo the inverted link state to the fault LED.
|
||||
*/
|
||||
if (miiphy_link(eth_get_dev()->name, CONFIG_SYS_FAULT_MII_ADDR))
|
||||
status_led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_OFF);
|
||||
else
|
||||
status_led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_ON);
|
||||
#endif /* CONFIG_SYS_FAULT_ECHO_LINK_DOWN, ... */
|
||||
#endif /* CONFIG_MII, ... */
|
||||
#ifdef CONFIG_USB_KEYBOARD
|
||||
net_busy_flag = 1;
|
||||
#endif
|
||||
@@ -688,22 +669,6 @@ restart:
|
||||
((get_timer(0) - time_start) > time_delta)) {
|
||||
thand_f *x;
|
||||
|
||||
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
|
||||
#if defined(CONFIG_SYS_FAULT_ECHO_LINK_DOWN) && \
|
||||
defined(CONFIG_LED_STATUS) && \
|
||||
defined(CONFIG_LED_STATUS_RED)
|
||||
/*
|
||||
* Echo the inverted link state to the fault LED.
|
||||
*/
|
||||
if (miiphy_link(eth_get_dev()->name,
|
||||
CONFIG_SYS_FAULT_MII_ADDR))
|
||||
status_led_set(CONFIG_LED_STATUS_RED,
|
||||
CONFIG_LED_STATUS_OFF);
|
||||
else
|
||||
status_led_set(CONFIG_LED_STATUS_RED,
|
||||
CONFIG_LED_STATUS_ON);
|
||||
#endif /* CONFIG_SYS_FAULT_ECHO_LINK_DOWN, ... */
|
||||
#endif /* CONFIG_MII, ... */
|
||||
debug_cond(DEBUG_INT_STATE, "--- net_loop timeout\n");
|
||||
x = time_handler;
|
||||
time_handler = (thand_f *)0;
|
||||
|
||||
Reference in New Issue
Block a user