Page MenuHomeFreeBSD

rge: add Wake-on-LAN support for magic packet
AcceptedPublic

Authored by chris.longros_gmail.com on Sun, Apr 5, 3:01 PM.

Details

Reviewers
adrian
Summary

Advertise IFCAP_WOL_MAGIC when PCI power management is available
and enable it by default. On suspend or shutdown, rge_setwol()
enables the WOL_MAGIC and WOL_LANWAKE bits in CFG3/CFG5, disables
the RXDV gate, and enables PM so the NIC stays powered to watch
for magic packets.

Move hardware-specific WOL register configuration into
rge_wol_config() in if_rge_hw.c to keep hardware-specific
functions in sync with OpenBSD.

Update rge.4 to document WoL support.

Tested on FreeBSD 16.0-CURRENT bare metal with Realtek RTL8125
on a Gigabyte B650 Gaming X AX motherboard.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Test Plan

Tested on FreeBSD 16.0-CURRENT bare metal with Realtek RTL8125 on a Gigabyte B650 Gaming X AX motherboard.
Sending a magic packet with wol from my Arch Linux laptop wakes up the FreeBSD desktop.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 71979
Build 68862: arc lint + arc unit

Event Timeline

chris.longros_gmail.com edited the test plan for this revision. (Show Details)
chris.longros_gmail.com edited the test plan for this revision. (Show Details)

hi! i'm trying to put as much hardware specific code into if_rge_hw.c to hopefully make it easier to keep whole hardware-specific routines in sync with openbsd.

Would you mind updating your diff to push the wol code back into if_rge_hw.c and call it there? thanks!

chris.longros_gmail.com edited the summary of this revision. (Show Details)

WOL configuration moved into rge_wol_config() in if_rge_hw.c. I retested the changes with FreeBSD 16-CURRENT and with real hardware.

adrian added a project: network.

Thanks! Lemme test it locally and then i'll pull it into -head.

This revision is now accepted and ready to land.Mon, Apr 6, 3:35 PM