Factor code in LinuxKPI to allow attach and detach using any BSD device.
This allows non-LinuxKPI based infiniband device drivers to attach
correctly to ibcore.
No functional change intended.
Reviewed by: np @
Differential Revision: https://reviews.freebsd.org/D24514
MFC after: 1 week
Sponsored by: Mellanox Technologies