If you call the kextstat command, it displays a list of all loaded kernel extensions with information like this: -
115 3 0xffffff7f814f4000 0x32000 0x32000 com.apple.iokit.IOAudioFamily (1.8.9fc11) <114 5 4 3 1>
The first number (115) is the kernel extension identifier.
At the end, the set of numbers <114 5 4 3 1> are the other kernel extension identifiers that this particular kext refers to.
If you match the identifier of your kext with any of those listed in another, then this is the link that kextunload refers to.
Also note that when writing any code in the kernel, the globals variables are global throughout the kernel, so if you declared that it might not be a unique name and is used by another kext, I found that it raises a similar question. The solution here is to add any global variables with the reverse company URI (e.g. com_apple_globalVarName).
source share