Skip to content

[net][k64f] Add access to link status in emac driver #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libraries/net/eth/lwip-eth/arch/TARGET_Freescale/k64f_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,13 @@ typedef struct {
enet_phy_duplex_t duplex;
} PHY_STATE;

int phy_link_status() {
bool connection_status;
enet_dev_if_t * enetIfPtr = (enet_dev_if_t*)&enetDevIf[BOARD_DEBUG_ENET_INSTANCE];
phy_get_link_status(enetIfPtr, &connection_status);
return (int)connection_status;
}

static void k64f_phy_task(void *data) {
struct netif *netif = (struct netif*)data;
bool connection_status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,15 @@

#define ENET_ETH_MAX_FLEN (1522) // recommended size for a VLAN frame

#if defined(__cplusplus)
extern "C" {
#endif

int phy_link_status(void);

#if defined(__cplusplus)
}
#endif

#endif // #define K64F_EMAC_CONFIG_H__