Support for broadcoms multifunctional devices

bnc#841170, fate#316090

and cleanup and so on.
Cleanup is good, except when it introduces a bug. This PR mixes a trivial change to fix the bug (commit ef02019937d14898363eead1225bf997a962818) and a cleanup of the involved method. I don't see new tests. Is it covered by existing tests?
If we have tests then we can clean up even more.