Combine v1 and v2 into one driver (.ko) and change initialization to
call v1 or v2 accordingly. The rest is handled by ib_device_ops
structure.
Is there a rule which says that a driver cannot export symbols? Module
stacking is useful for more complex drivers, in that a hw-specific
implementation may plug into common driver. This helps code reuse.
Hi Jason,
Generally we do not like to see leaf drivers be so complicated that
they need to export symbols.A multi-module driver is generally an
over engineered thing to do, few drivers would be so big for that to
make any sense.
I wouldn't say that any driver needs to have multiple modules simply
because it is big.
But in the case of this driver, the requirement of supporting different
hw revisions, dependencies on different network drivers, and also the
need to support either platform or pci device driver was the motivation.
In addition to this, v1 hw is a platform device driver and depends on HNS,
while v2 hw is for a PCI device and depends on PCI && HNS3. Attempts to
combine into a single ko would introduce messy dependencies and ifdefs.
I suspect it would not be any different from how it is today. Do
everything the same, just have one module not three. module_init/etc
already take care of conditional compilation of the entire .c file via
Makefile
We can try it, but I'm not sure how much the complexity of the driver
will be reduced.
Cheers,
John
Jason
.