Page MenuHomeFreeBSD

FDT: implement fdt_ether_get_addr()
Needs ReviewPublic

Authored by mmel on Wed, Jul 8, 11:29 AM.
Tags
None
Referenced Files
F162320300: D58104.diff
Sun, Jul 12, 12:54 AM
F162309442: D58104.diff
Sat, Jul 11, 10:32 PM
Unknown Object (File)
Fri, Jul 10, 10:15 PM
Unknown Object (File)
Fri, Jul 10, 10:51 AM
Unknown Object (File)
Fri, Jul 10, 7:52 AM
Unknown Object (File)
Thu, Jul 9, 7:54 PM
Unknown Object (File)
Thu, Jul 9, 7:32 PM

Details

Reviewers
manu
adrian
bz
mhorne
Group Reviewers
arm64
Summary

Introduce fdt_ether_get_addr() in fdt_common.c/h that tries standard
DT properties in the correct order and falls back to a random address
when needed. This should be used by ethernet drivers instead of open-coding
the same logic.

MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74648
Build 71531: arc lint + arc unit

Event Timeline

mmel requested review of this revision.Wed, Jul 8, 11:29 AM
jrtc27 added inline comments.
sys/dev/fdt/fdt_common.c
566

OOI why not fdt_ether_get_addr given ether_gen_addr (and the MAC is kind of a given for ethernet)? Or, if keeping the mac, should probably separate with an underscore?

This comment was removed by jrtc27.
sys/dev/fdt/fdt_common.c
571

.

bz requested changes to this revision.Wed, Jul 8, 10:23 PM
bz added a subscriber: bz.

I'll be happy if this lands as I'll finally be able to ditch (updated versions) of https://reviews.freebsd.org/D23145 out of my tree. Thank you!

sys/dev/fdt/fdt_common.c
589

One is eaddr, one is tmp here; that looks wrong?

This revision now requires changes to proceed.Wed, Jul 8, 10:23 PM

Rename function and fix cut&paste error

mmel retitled this revision from FDT: implement fdt_ether_get_macaddr() to FDT: implement fdt_ether_get_addr().Thu, Jul 9, 8:40 AM
mmel edited the summary of this revision. (Show Details)

remove redundant empty line

mmel marked 3 inline comments as done.
mhorne added a subscriber: mhorne.

LGTM. There was a recent addition to if_eqos_starfive to handle "local-mac-address", but it will be better to use this. Thanks.