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
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);
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
#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>
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
((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;