Page MenuHomeFreeBSD

FDT: implement fdt_ether_get_addr()
ClosedPublic

Authored by mmel on Wed, Jul 8, 11:29 AM.
Tags
None
Referenced Files
F162696356: D58104.id.diff
Wed, Jul 15, 9:21 PM
F162671406: D58104.id181592.diff
Wed, Jul 15, 2:09 PM
F162671091: D58104.id181592.diff
Wed, Jul 15, 2:06 PM
Unknown Object (File)
Wed, Jul 15, 7:59 AM
Unknown Object (File)
Wed, Jul 15, 7:29 AM
Unknown Object (File)
Wed, Jul 15, 7:29 AM
Unknown Object (File)
Wed, Jul 15, 3:35 AM
Unknown Object (File)
Wed, Jul 15, 2:06 AM

Details

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 74647
Build 71530: 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.

This revision was not accepted when it landed; it landed in state Needs Review.Mon, Jul 13, 8:37 AM
This revision was automatically updated to reflect the committed changes.