Page MenuHomeFreeBSD

FDT: implement fdt_ether_get_addr()
ClosedPublic

Authored by mmel on Wed, Jul 8, 11:29 AM.
Tags
None
Referenced Files
F162448969: D58104.diff
Mon, Jul 13, 10:05 AM
F162416861: D58104.id181591.diff
Mon, Jul 13, 1:39 AM
F162412756: D58104.id181529.diff
Mon, Jul 13, 12:39 AM
F162403931: D58104.diff
Sun, Jul 12, 10:21 PM
F162403741: D58104.diff
Sun, Jul 12, 10:17 PM
F162398859: D58104.id181592.diff
Sun, Jul 12, 9:04 PM
F162392625: D58104.id181593.diff
Sun, Jul 12, 7:56 PM
F162373925: D58104.id181592.diff
Sun, Jul 12, 3:03 PM

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 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.

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.