您可以从模块A提供回调函数。在这种情况下,您无需将所需的每个函数导出到内核名称空间。我想您可以为B提供一些结构。
内部标头:
struct possible_ops { int (*xmit)(...);};A:
struct private { struct possible_ops *ops;};... ops = kzalloc(sizeof(*ops));ops->xmit = xmit;B:
whatever(struct possible_ops *ops) { if (ops && ops->xmit) { ret = ops->xmit(); ... }}


