Page MenuHomeFreeBSD

Fix compilation of kernels with usb and fdt enabled, but no miibus
ClosedPublic

Authored by stevek on Aug 16 2019, 5:13 PM.
Tags
None
Referenced Files
F114667856: D21293.diff
Tue, Apr 15, 3:52 AM
F114667556: D21293.id.diff
Tue, Apr 15, 3:48 AM
F114667190: D21293.id61026.diff
Tue, Apr 15, 3:43 AM
F114667116: D21293.id60898.diff
Tue, Apr 15, 3:42 AM
Unknown Object (File)
Sun, Apr 6, 2:48 AM
Unknown Object (File)
Wed, Mar 26, 11:26 AM
Unknown Object (File)
Mar 2 2025, 8:55 PM
Unknown Object (File)
Mar 2 2025, 8:48 PM
Subscribers

Details

Summary

usb_ethernet.h includes a number of mii headers, but only does so in
order to have struct mii_data available. However, it only really needs
a forward declaration of struct mii_data for use in pointer form for
the return type of a function prototype.

Custom kernel configuration that have usb and fdt enabled, but no miibus,
end up with compilation failures because miibus_if.h will not get
generated.

Due to the above, the following changes have been made to usb_ethernet.h:

  • remove the inclusion of mii headers
  • forward-declare struct mii_data
  • include net/ifq.h to satify the need for complete struct ifqueue
Test Plan

Built "kernels" successfully

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

looks fine as far as it goes, but what's including this? usb_ethernet.c certainly needs miibus too compile...

Ah, I see where it's used now. There are several alternatives, but this is the least bad one that comes to mind.
We have a little bit of dead code vs having #ifdefs for FDT in usb_ethernet.c.
It's more modular to have it like this, so I'm cool with it.

This revision is now accepted and ready to land.Aug 16 2019, 5:39 PM