Lines Matching refs:dev_ctx

53 	struct mlx4_device_context *dev_ctx;  in mlx4_add_device()  local
55 dev_ctx = kmalloc(sizeof *dev_ctx, GFP_KERNEL); in mlx4_add_device()
56 if (!dev_ctx) in mlx4_add_device()
59 dev_ctx->intf = intf; in mlx4_add_device()
60 dev_ctx->context = intf->add(&priv->dev); in mlx4_add_device()
62 if (dev_ctx->context) { in mlx4_add_device()
64 list_add_tail(&dev_ctx->list, &priv->ctx_list); in mlx4_add_device()
67 intf->activate(&priv->dev, dev_ctx->context); in mlx4_add_device()
69 kfree(dev_ctx); in mlx4_add_device()
75 struct mlx4_device_context *dev_ctx; in mlx4_remove_device() local
77 list_for_each_entry(dev_ctx, &priv->ctx_list, list) in mlx4_remove_device()
78 if (dev_ctx->intf == intf) { in mlx4_remove_device()
80 list_del(&dev_ctx->list); in mlx4_remove_device()
83 intf->remove(&priv->dev, dev_ctx->context); in mlx4_remove_device()
84 kfree(dev_ctx); in mlx4_remove_device()
132 struct mlx4_device_context *dev_ctx = NULL, *temp_dev_ctx; in mlx4_do_bond() local
158 list_for_each_entry_safe(dev_ctx, temp_dev_ctx, &priv->ctx_list, list) { in mlx4_do_bond()
159 if (dev_ctx->intf->flags & MLX4_INTFF_BONDING) { in mlx4_do_bond()
160 list_add_tail(&dev_ctx->bond_list, &bond_list); in mlx4_do_bond()
161 list_del(&dev_ctx->list); in mlx4_do_bond()
166 list_for_each_entry(dev_ctx, &bond_list, bond_list) { in mlx4_do_bond()
167 dev_ctx->intf->remove(dev, dev_ctx->context); in mlx4_do_bond()
168 dev_ctx->context = dev_ctx->intf->add(dev); in mlx4_do_bond()
171 list_add_tail(&dev_ctx->list, &priv->ctx_list); in mlx4_do_bond()
175 dev_ctx->intf->protocol, enable ? in mlx4_do_bond()
185 struct mlx4_device_context *dev_ctx; in mlx4_dispatch_event() local
190 list_for_each_entry(dev_ctx, &priv->ctx_list, list) in mlx4_dispatch_event()
191 if (dev_ctx->intf->event) in mlx4_dispatch_event()
192 dev_ctx->intf->event(dev, dev_ctx->context, type, param); in mlx4_dispatch_event()
235 struct mlx4_device_context *dev_ctx; in mlx4_get_protocol_dev() local
241 list_for_each_entry(dev_ctx, &priv->ctx_list, list) in mlx4_get_protocol_dev()
242 if (dev_ctx->intf->protocol == proto && dev_ctx->intf->get_dev) { in mlx4_get_protocol_dev()
243 result = dev_ctx->intf->get_dev(dev, dev_ctx->context, port); in mlx4_get_protocol_dev()