Page MenuHomeFreeBSD

asmc: add Wake-on-LAN control via sysctl
Needs ReviewPublic

Authored by seuros_seuros.com on Wed, Dec 31, 5:47 PM.
Tags
None
Referenced Files
F141132114: D54439.id.diff
Thu, Jan 1, 7:12 AM
F141125606: D54439.diff
Thu, Jan 1, 4:58 AM
F141119621: D54439.id.diff
Thu, Jan 1, 3:08 AM
Unknown Object (File)
Wed, Dec 31, 9:48 PM
Unknown Object (File)
Wed, Dec 31, 9:21 PM
Subscribers
None

Details

Reviewers
adrian
imp
markj
Summary

Apple Mac systems support Wake-on-LAN from powered-off state (S5/G2) via the AUPO SMC key.

This change adds a convenience sysctl:

dev.asmc.0.wol (0=disabled, 1=enabled)

The AUPO key is volatile and resets to 0x00 on every boot, so WoL must be manually enabled before each shutdown to work from powered-off state.
Users need to run:
sysctl dev.asmc.0.wol=1
before shutting down the system.

Test Plan

Tested on Mac Mini 5,1 (FreeBSD 16.0-CURRENT):

  1. Boot system, check default WoL state:
  • sysctl dev.asmc.0.wol
  • Expected: 0 (disabled - AUPO resets on boot)
  1. Enable WoL before shutdown:
  • sudo sysctl dev.asmc.0.wol=1
  • Expected: Returns 1, no errors
  1. Verify AUPO was set:
  • sudo sysctl dev.asmc.0.wol
  • Expected: 1
  1. Shutdown system:
  • sudo shutdown -p now
  1. From another machine, send magic packet:
  • wakeonlan -i 192.168.3.255 <MAC_ADDRESS> <-- use your local ip range
  • Expected: System powers on and boots
  1. After boot, verify WoL state reset:
  • sysctl dev.asmc.0.wol
  • Expected: 0 (AUPO volatile, resets on boot)
  1. Test disable: (it disabled by default)
  • sudo sysctl dev.asmc.0.wol=1
  • sudo sysctl dev.asmc.0.wol=0
  • sudo shutdown -p now
  • Send magic packet

Note: My thunderbird ethernet cable is broken, so i could not test it in the laptops.

The user need to build rc.d integration or shutdown hook to keep the value set to 1

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

seuros_seuros.com created this revision.
seuros_seuros.com edited the test plan for this revision. (Show Details)

i got the patch from the wrong branch, the first time.