On 06/04/2018 05:50 AM, Sergey Matyukevich wrote:
I think it's better be moved somewhere out of qtnf_wiphy_allocate() as OPS
are global for all MACs, while qtnf_wiphy_allocate() is called for each MAC
separately.
Consider the case of splitting hardware capabilities into two groups:
global and per-wmac. In this case we may need to register different
subsets of cfg80211 operations for each wmac. In such a case, function
qtnf_wiphy_allocate looks like a reasonable point where to merge both
capability groups and customize cfg80211_ops structure for each wmac.
What I mean is that wiphy_new() will not dup cfg80211_ops that we pass,
it will just assign a pointer to whatever it gets.
qtn_cfg80211_ops is global right now, if we modify it, it will affect
all WMACs, not just the one that we're allocating.
Currently it's not a problem as we do not have any per-WMAC
capabilities. If we to have any, we would have to dup qtn_cfg80211_ops
in qtnf_wiphy_allocate().
Though I agree that we already have QLINK_HW_CAPAB_DFS_OFFLOAD
processing in qtnf_wiphy_allocate(), so it makes sense to do a cleanup
separately.