* @internal * @brief Register the pass level of a new driver attachment * * Register a new driver attachment's pass level. If no driver * attachment with the same pass level has been added, then @p new * will be added to the global passes list. * * @param new the new driver attachment */
| 880 | * @param new the new driver attachment |
| 881 | */ |
| 882 | static void |
| 883 | driver_register_pass(struct driverlink *new) |
| 884 | { |
| 885 | struct driverlink *dl; |
| 886 | |
| 887 | /* We only consider pass numbers during boot. */ |
| 888 | if (bus_current_pass == BUS_PASS_DEFAULT) |
| 889 | return; |
| 890 | |
| 891 | /* |
| 892 | * Walk the passes list. If we already know about this pass |
| 893 | * then there is nothing to do. If we don't, then insert this |
| 894 | * driver link into the list. |
| 895 | */ |
| 896 | TAILQ_FOREACH(dl, &passes, passlink) { |
| 897 | if (dl->pass < new->pass) |
| 898 | continue; |
| 899 | if (dl->pass == new->pass) |
| 900 | return; |
| 901 | TAILQ_INSERT_BEFORE(dl, new, passlink); |
| 902 | return; |
| 903 | } |
| 904 | TAILQ_INSERT_TAIL(&passes, new, passlink); |
| 905 | } |
| 906 | |
| 907 | /** |
| 908 | * @brief Raise the current bus pass |
no outgoing calls
no test coverage detected