Lines Matching refs:port

72 	struct mcast_port	port[0];
97 struct mcast_port *port;
128 static struct mcast_group *mcast_find(struct mcast_port *port,
131 struct rb_node *node = port->table.rb_node;
149 static struct mcast_group *mcast_insert(struct mcast_port *port,
153 struct rb_node **link = &port->table.rb_node;
174 rb_insert_color(&group->node, &port->table);
178 static void deref_port(struct mcast_port *port)
180 if (atomic_dec_and_test(&port->refcount))
181 complete(&port->comp);
186 struct mcast_port *port = group->port;
189 spin_lock_irqsave(&port->lock, flags);
191 rb_erase(&group->node, &port->table);
192 spin_unlock_irqrestore(&port->lock, flags);
194 deref_port(port);
196 spin_unlock_irqrestore(&port->lock, flags);
302 struct mcast_port *port = group->port;
306 ret = ib_sa_mcmember_rec_query(&sa_client, port->dev->device,
307 port->port_num, IB_MGMT_METHOD_SET,
321 struct mcast_port *port = group->port;
329 ret = ib_sa_mcmember_rec_query(&sa_client, port->dev->device,
330 port->port_num, IB_SA_METHOD_DELETE, &rec,
370 ret = ib_find_pkey(group->port->dev->device,
371 group->port->port_num,
498 ib_find_pkey(group->port->dev->device, group->port->port_num,
501 spin_lock_irq(&group->port->lock);
507 rb_erase(&group->node, &group->port->table);
508 mcast_insert(group->port, group, 1);
510 spin_unlock_irq(&group->port->lock);
527 static struct mcast_group *acquire_group(struct mcast_port *port,
536 spin_lock_irqsave(&port->lock, flags);
537 group = mcast_find(port, mgid);
540 spin_unlock_irqrestore(&port->lock, flags);
548 group->port = port;
556 spin_lock_irqsave(&port->lock, flags);
557 cur_group = mcast_insert(port, group, is_mgid0);
562 atomic_inc(&port->refcount);
565 spin_unlock_irqrestore(&port->lock, flags);
608 member->group = acquire_group(&dev->port[port_num - dev->start_port],
667 struct mcast_port *port;
676 port = &dev->port[port_num - dev->start_port];
677 spin_lock_irqsave(&port->lock, flags);
678 group = mcast_find(port, mgid);
683 spin_unlock_irqrestore(&port->lock, flags);
719 static void mcast_groups_event(struct mcast_port *port,
726 spin_lock_irqsave(&port->lock, flags);
727 for (node = rb_first(&port->table); node; node = rb_next(node)) {
738 spin_unlock_irqrestore(&port->lock, flags);
759 mcast_groups_event(&dev->port[index], MCAST_GROUP_ERROR);
762 mcast_groups_event(&dev->port[index], MCAST_PKEY_EVENT);
772 struct mcast_port *port;
779 dev = kmalloc(sizeof *dev + device->phys_port_cnt * sizeof *port,
795 port = &dev->port[i];
796 port->dev = dev;
797 port->port_num = dev->start_port + i;
798 spin_lock_init(&port->lock);
799 port->table = RB_ROOT;
800 init_completion(&port->comp);
801 atomic_set(&port->refcount, 1);
820 struct mcast_port *port;
833 port = &dev->port[i];
834 deref_port(port);
835 wait_for_completion(&port->comp);