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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/usb/net/if_muge.c
1438 ↗(On Diff #44827)

Why FreeBSD-specific?

1543 ↗(On Diff #44827)

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 ↗(On Diff #44827)

Copypaste mistake

1543 ↗(On Diff #44827)

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 ↗(On Diff #44828)

extra 'r' in store

1509 ↗(On Diff #44828)

matching

1547–1551 ↗(On Diff #44828)

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

1569–1570 ↗(On Diff #44828)

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.