On 2015-11-12 23:00, Johannes Berg wrote: > From: Johannes Berg <johannes.berg@xxxxxxxxx> > > There are many drivers with different behaviour, but in a lot of > systems only a single driver will ever be built. In that case we > can get rid of code paths that this driver doesn't need and also > optimize the ones that it always takes to not have a check. > > To make that possible, make use Kconfig counters to > (a) the number of times each feature flag was desired > (b) the number of mac80211 drivers built > and use Kconfig selects to select those flags that any drivers > need to be dynamic (e.g. if they can only determine this flag's > setting at runtime.) > > If the dynamic request isn't set then > > if (a) > 0 then it was requested ON by at least one driver > if (a) < (b) then it was requested OFF by at least one driver So one issue with this logic is that it is not safe to build and use an out-of-tree mac80211 driver after the kernel has been built. Also, any new driver needs the 'count MAC80211_NUM_DRIVERS' annotation, but there is the runtime check to catch omissions. Since this is targeting users of very specific configs, how about an opt-in scheme à la - User has to select CONFIG_MAC80211_SINGLE_DRIVER, the help text explains the caveats and lists drivers known to work in such mode. - mac80211 uses the Kconfig-defined constants + dynamic bits iff CONFIG_MAC80211_SINGLE_DRIVER=y, otherwise it behaves as before. - Some build- or compile-time check ensuring that we are not building / loading multiple drivers with CONFIG_MAC80211_SINGLE_DRIVER=y. ? It's not very robust either, but at least it would only be used by those who know what they are doing. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html