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
Unknown Object (File)
Oct 21 2024, 1:53 PM
Unknown Object (File)
Oct 21 2024, 1:53 PM
Unknown Object (File)
Oct 21 2024, 1:53 PM
Unknown Object (File)
Oct 21 2024, 1:53 PM
Unknown Object (File)
Oct 21 2024, 1:53 PM
Unknown Object (File)
Oct 21 2024, 1:42 PM
Unknown Object (File)
Oct 16 2024, 8:39 AM
Unknown Object (File)
Oct 1 2024, 3:14 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.