kernels/linux-2.4.0/drivers/ieee1394/hosts.c
/*
 * This function calls the add_host/remove_host hooks for every host currently
 * registered.  Init == TRUE means add_host.
 */
This function calls the add_host/remove_host hooks for every host currently
registered.  Init == TRUE means add_host.
This function calls the add_host / remove_host hooks for every host currently registered . Init == TRUE means add_host .
void hl_all_hosts(struct hpsb_highlevel *hl, int init)
{
        struct hpsb_host_template *tmpl;
        struct hpsb_host *host;
        spin_lock(&templates_lock);
        for (tmpl = templates; tmpl != NULL; tmpl = tmpl->next) {
                for (host = tmpl->hosts; host != NULL; host = host->next) {
                        if (host->initialized) {
                                if (init) {
                                        if (hl->op->add_host) {
                                                hl->op->add_host(host);
                                        }
                                } else {
                                        if (hl->op->remove_host) {
                                                hl->op->remove_host(host);
                                        }
                                }
                        }
                }
        }
        spin_unlock(&templates_lock);
}
void hl_all_hosts ( struct hpsb_highlevel * hl , int init ) { struct hpsb_host_template * tmpl ; struct hpsb_host * host ; spin_lock ( & templates_lock ) ; for ( tmpl = templates ; tmpl != NULL ; tmpl = tmpl -> next ) { for ( host = tmpl -> hosts ; host != NULL ; host = host -> next ) { if ( host -> initialized ) { if ( init ) { if ( hl -> op -> add_host ) { hl -> op -> add_host ( host ) ; } } else { if ( hl -> op -> remove_host ) { hl -> op -> remove_host ( host ) ; } } } } } spin_unlock ( & templates_lock ) ; }
This function calls the add_host/remove_host hooks for every host currently
 registered.
This function calls the add_host / remove_host hooks for every host currently registered .