Page MenuHomeFreeBSD

muge(4): add DTB blob as one more possible source of MAC address
ClosedPublic

Authored by gonzo on Jul 3 2018, 8:27 PM.
Tags
None
Referenced Files
F132570181: D16117.diff
Sat, Oct 18, 1:44 AM
F132552288: D16117.id.diff
Fri, Oct 17, 10:13 PM
Unknown Object (File)
Fri, Oct 17, 3:52 AM
Unknown Object (File)
Wed, Oct 15, 11:29 PM
Unknown Object (File)
Mon, Oct 13, 7:44 AM
Unknown Object (File)
Mon, Oct 13, 3:47 AM
Unknown Object (File)
Mon, Sep 22, 12:22 AM
Unknown Object (File)
Sun, Sep 21, 10:48 PM
Subscribers

Details

Summary

Overall procedure is to find DTB node with comaptible string "usbVID,PID"
and try to obtain MAC address from mac-address and local-mac-address fields

Test Plan

Tested in RPi3B+, FreeBSD uses MAC address matching the one provided by the firmware

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17826
Build 17599: arc lint + arc unit

Event Timeline

sys/dev/usb/net/if_muge.c
1438

Why FreeBSD-specific?

1552

Perhaps we should refactor this into a muge_set_mac_addr or such first? Or I'm happy to do it afterwards.

sys/dev/usb/net/if_muge.c
1438

Copypaste mistake

1552

Will do

  • Added documentation
  • Removed some stale comments
  • Refactored MAC-stting part into muge_set_mac_addr function

Some suggestions but overall I think this is fine. I can futz with it after commit otherwise.

sys/dev/usb/net/if_muge.c
1468

extra 'r' in store

1509

matching

1546–1547

This comment is probably not correct (at least, not correct at this location) now.

1563–1564

Given this is moved out into a function we could use early-return instead

This revision is now accepted and ready to land.Jul 3 2018, 9:43 PM
  • Spelling fixes
  • A bit more refactoring
This revision now requires review to proceed.Jul 3 2018, 10:30 PM
This revision is now accepted and ready to land.Jul 4 2018, 12:03 AM
This revision was automatically updated to reflect the committed changes.