Page MenuHomeFreeBSD

"device axp" requires miibus
ClosedPublic

Authored by bofh on Tue, Feb 2, 9:49 PM.

Details

Summary

I was trying to build a custom kernel. As I don't need miibus based interfaces I tried to build the kernel it failed with the following error:

  /usr/src/sys/dev/axgbe/if_axgbe_pci.c
/usr/src/sys/dev/axgbe/if_axgbe_pci.c:58:10: fatal error: 'miibus_if.h' file not found
#include "miibus_if.h"
         ^~~~~~~~~~~~~

Adding miibus fixes the build. Although I just removed axp for my purpose.

So this patch just notifies that this module requires miibus. Although I am not sure why an iflib based interface will require miibus.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bofh requested review of this revision.Tue, Feb 2, 9:49 PM
bofh created this revision.
bofh edited the summary of this revision. (Show Details)

Other than the comment mentioned, this patch looks good to me.

Although I am not sure why an iflib based interface will require miibus.

Regarding this, As this driver is supposed to be unified driver for both SFP and MII interfaces, we added the miibus interfaces. Should we try avoid using miibus and iflib together? If so, how to implement unified drivers (supporting MII and SFP)?

sys/amd64/conf/NOTES
313

Hi @bofh , axp driver needs miibus only for direct RJ45 interfaces and not for SFP and SFP+ interfaces. So, can this comment add that something like "Requires the miibus module for RJ45 interfaces"?

Change in "GENERIC" file is fine. But, in NOTES it would be good if some details added.

Other than the comment mentioned, this patch looks good to me.

Thanks.

Although I am not sure why an iflib based interface will require miibus.

Regarding this, As this driver is supposed to be unified driver for both SFP and MII interfaces, we added the miibus interfaces. Should we try avoid using miibus and iflib together? If so, how to implement unified drivers (supporting MII and SFP)?

One option maybe to split it into two rather than unified.

sys/amd64/conf/NOTES
313

This might be counter productive or more confusing. Because the build system cannot detect or know which one I will use and eventually if I think that I won't need the RJ-45 so lets remove miibus it won't build the kernel. :P

bofh marked an inline comment as not done.Wed, Feb 3, 6:34 PM

One option maybe to split it into two rather than unified.

Our initial plan is to have a single driver in sync with how it's in Linux for easy managing. Let's have it this way for now and decide on the split as per the need.

sys/amd64/conf/NOTES
313

Ok. Then this change is fine.

This revision is now accepted and ready to land.Wed, Feb 3, 6:51 PM
imp added a subscriber: imp.

Seems good to me.