Skip to content

netopt/drivers: Add phy link status output#8601

Merged
miri64 merged 4 commits intoRIOT-OS:masterfrom
bergzand:pr/netopt-link-status
Mar 18, 2018
Merged

netopt/drivers: Add phy link status output#8601
miri64 merged 4 commits intoRIOT-OS:masterfrom
bergzand:pr/netopt-link-status

Conversation

@bergzand
Copy link
Copy Markdown
Member

@bergzand bergzand commented Feb 20, 2018

Contribution description

This PR adds netopt support to query the status of the phy link of a network driver, whether a cable is attached and the link is functional. Output for the ifconfig command to report this status is added.

Issues/PRs references

None

Todo

Other drivers beside the enc28j60:

  • netdev_tap
  • encx24j600
    w5100

@bergzand bergzand added Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: drivers Area: Device drivers labels Feb 20, 2018
@bergzand
Copy link
Copy Markdown
Member Author

The w5100 doesn't seem to support reporting link status information :(

Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-wise ACK. Don't have the hardware to test.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Mar 15, 2018

Maybe @kaspar030 can test?

@bergzand
Copy link
Copy Markdown
Member Author

Netdev_tap support seems a bit complicated. While it is possible to put the tap device in a down state on the OS side, I couldn't retrieve the status from within RIOT.

@basilfx
Copy link
Copy Markdown
Member

basilfx commented Mar 16, 2018

Tested this with a enc28j60 with tests/driver_ enc28j60.

schermafbeelding 2018-03-16 om 20 52 23

NETOPT_IS_WIRED,

/**
* @brief Get the Phy link status.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you adapt for the documentation style in #8655, please?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, I've adapted the @brief to the style of #8655 and reworded the full description a bit to specify behaviour more precise.

Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, please squash!

@miri64 miri64 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 18, 2018
@miri64
Copy link
Copy Markdown
Member

miri64 commented Mar 18, 2018

(If netdev_tap is somehow possible, we always can do this in a follow-up)

@bergzand bergzand force-pushed the pr/netopt-link-status branch from 2c94071 to eb9e2da Compare March 18, 2018 14:33
@bergzand
Copy link
Copy Markdown
Member Author

Squashed!

(If netdev_tap is somehow possible, we always can do this in a follow-up)

Yes, I probably just lack the correct knowledge about how to get the information via some syscall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants