Lines Matching refs:nets
79 static struct rionet_net nets[RIONET_MAX_NETS]; variable
182 add_num = nets[rnet->mport->id].nact; in rionet_start_xmit()
197 if (nets[rnet->mport->id].active[i]) { in rionet_start_xmit()
199 nets[rnet->mport->id].active[i]); in rionet_start_xmit()
206 if (nets[rnet->mport->id].active[destid]) in rionet_start_xmit()
208 nets[rnet->mport->id].active[destid]); in rionet_start_xmit()
239 if (!nets[netid].active[sid]) { in rionet_dbell_event()
240 spin_lock(&nets[netid].lock); in rionet_dbell_event()
241 list_for_each_entry(peer, &nets[netid].peers, node) { in rionet_dbell_event()
243 nets[netid].active[sid] = peer->rdev; in rionet_dbell_event()
244 nets[netid].nact++; in rionet_dbell_event()
247 spin_unlock(&nets[netid].lock); in rionet_dbell_event()
253 spin_lock(&nets[netid].lock); in rionet_dbell_event()
254 if (nets[netid].active[sid]) { in rionet_dbell_event()
255 nets[netid].active[sid] = NULL; in rionet_dbell_event()
256 nets[netid].nact--; in rionet_dbell_event()
258 spin_unlock(&nets[netid].lock); in rionet_dbell_event()
354 spin_lock_irqsave(&nets[netid].lock, flags); in rionet_open()
355 list_for_each_entry(peer, &nets[netid].peers, node) { in rionet_open()
359 spin_unlock_irqrestore(&nets[netid].lock, flags); in rionet_open()
384 spin_lock_irqsave(&nets[netid].lock, flags); in rionet_close()
385 list_for_each_entry(peer, &nets[netid].peers, node) { in rionet_close()
386 if (nets[netid].active[peer->rdev->destid]) { in rionet_close()
388 nets[netid].active[peer->rdev->destid] = NULL; in rionet_close()
393 spin_unlock_irqrestore(&nets[netid].lock, flags); in rionet_close()
414 spin_lock_irqsave(&nets[netid].lock, flags); in rionet_remove_dev()
415 list_for_each_entry(peer, &nets[netid].peers, node) { in rionet_remove_dev()
418 if (nets[netid].active[rdev->destid]) { in rionet_remove_dev()
425 nets[netid].active[rdev->destid] = NULL; in rionet_remove_dev()
426 nets[netid].nact--; in rionet_remove_dev()
432 spin_unlock_irqrestore(&nets[netid].lock, flags); in rionet_remove_dev()
490 nets[mport->id].active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, in rionet_setup_netdev()
492 if (!nets[mport->id].active) { in rionet_setup_netdev()
496 memset((void *)nets[mport->id].active, 0, rionet_active_bytes); in rionet_setup_netdev()
529 free_pages((unsigned long)nets[mport->id].active, in rionet_setup_netdev()
563 if (!nets[netid].ndev) { in rionet_add_dev()
590 INIT_LIST_HEAD(&nets[netid].peers); in rionet_add_dev()
591 spin_lock_init(&nets[netid].lock); in rionet_add_dev()
592 nets[netid].nact = 0; in rionet_add_dev()
593 nets[netid].ndev = ndev; in rionet_add_dev()
604 rnet = netdev_priv(nets[netid].ndev); in rionet_add_dev()
622 spin_lock_irqsave(&nets[netid].lock, flags); in rionet_add_dev()
623 list_add_tail(&peer->node, &nets[netid].peers); in rionet_add_dev()
624 spin_unlock_irqrestore(&nets[netid].lock, flags); in rionet_add_dev()
648 if (!nets[i].ndev) in rionet_shutdown()
651 spin_lock_irqsave(&nets[i].lock, flags); in rionet_shutdown()
652 list_for_each_entry(peer, &nets[i].peers, node) { in rionet_shutdown()
653 if (nets[i].active[peer->rdev->destid]) { in rionet_shutdown()
656 nets[i].active[peer->rdev->destid] = NULL; in rionet_shutdown()
659 spin_unlock_irqrestore(&nets[i].lock, flags); in rionet_shutdown()
674 WARN(nets[id].nact, "%s called when connected to %d peers\n", in rionet_remove_mport()
675 __func__, nets[id].nact); in rionet_remove_mport()
676 WARN(!nets[id].ndev, "%s called for mport without NDEV\n", in rionet_remove_mport()
679 if (nets[id].ndev) { in rionet_remove_mport()
680 ndev = nets[id].ndev; in rionet_remove_mport()
684 free_pages((unsigned long)nets[id].active, in rionet_remove_mport()
687 nets[id].active = NULL; in rionet_remove_mport()
689 nets[id].ndev = NULL; in rionet_remove_mport()