Issue
Let's say I have drivers A and B in the Linux kernel space, with devices bound to them. I would like to export API in the driver A to B to provide list of devices bound to the driver A. Is it possible for a driver A to get to know about all devices currently being detected and bound to that driver?
Solution
Yes, simply register functions with A when driver B loads and call same function whenever device list is required. e.g
Driver A <<< register_func(func_ptr_list); export register_func Driver B <<< Call register_func with function list.
Multiple driver talks to each other using similar function element. for example Look at module_int for cxgb4 and cxgb4i
Answered By - tej parkash Answer Checked By - Candace Johnson (WPSolving Volunteer)