USB: reorganize code in hub.c