Skip to content
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

drivers/w5500: fix W5500 link up/down events in interrupt mode #20728

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

LP-HAW
Copy link
Contributor

@LP-HAW LP-HAW commented Jun 5, 2024

Contribution description

This PR fixes link up/down events in the W5500 driver in interrupt mode. Apparently the W5500 in MACRAW mode does not generate an interrupt when the link goes up or down. Work around this by polling even in interrupt mode.

I noticed that the W5500 interface would not configure an address after a reset until it received a packet. Also, addresses assigned to the interface are not removed and reconfigured when the network cable is unplugged and plugged back in.

Testing procedure

  1. Build RIOT with W5500 in interrupt mode, e.g.
    USEMODULE="w5500 auto_init_w5500" CFLAGS="-DW5500_PARAM_INT=GPIO_PIN\(0,0\)" make -C examples/gcoap all flash term

  2. Unplug network cable

  3. Run ifconfig

Without this PR:

The interface is down but still assigned an IPv6 address.

With this PR:

The interface has no address assigned to it.

Issues/PRs references

None

@github-actions github-actions bot added Area: tests Area: tests and testing framework Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration labels Jun 5, 2024
@benpicco benpicco added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Jun 5, 2024
drivers/w5500/w5500.c Outdated Show resolved Hide resolved
drivers/w5500/w5500.c Outdated Show resolved Hide resolved
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 5, 2024
@riot-ci
Copy link

riot-ci commented Jun 5, 2024

Murdock results

✔️ PASSED

8ab2c79 drivers/w5500: enable polling in interrupt mode

Success Failures Total Runtime
10161 0 10161 19m:06s

Artifacts

@benpicco benpicco added this pull request to the merge queue Jun 5, 2024
Merged via the queue into RIOT-OS:master with commit c20a9d1 Jun 5, 2024
27 checks passed
@mguetschow mguetschow added this to the Release 2024.07 milestone Jun 11, 2024
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: Kconfig Area: Kconfig integration Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants