Lines Matching refs:dev_ctx
54 struct mlx4_device_context *dev_ctx; in mlx4_add_device() local
56 dev_ctx = kmalloc(sizeof(*dev_ctx), GFP_KERNEL); in mlx4_add_device()
57 if (!dev_ctx) in mlx4_add_device()
60 dev_ctx->intf = intf; in mlx4_add_device()
61 dev_ctx->context = intf->add(&priv->dev); in mlx4_add_device()
63 if (dev_ctx->context) { in mlx4_add_device()
65 list_add_tail(&dev_ctx->list, &priv->ctx_list); in mlx4_add_device()
68 intf->activate(&priv->dev, dev_ctx->context); in mlx4_add_device()
70 kfree(dev_ctx); in mlx4_add_device()
76 struct mlx4_device_context *dev_ctx; in mlx4_remove_device() local
78 list_for_each_entry(dev_ctx, &priv->ctx_list, list) in mlx4_remove_device()
79 if (dev_ctx->intf == intf) { in mlx4_remove_device()
81 list_del(&dev_ctx->list); in mlx4_remove_device()
84 intf->remove(&priv->dev, dev_ctx->context); in mlx4_remove_device()
85 kfree(dev_ctx); in mlx4_remove_device()
133 struct mlx4_device_context *dev_ctx = NULL, *temp_dev_ctx; in mlx4_do_bond() local
159 list_for_each_entry_safe(dev_ctx, temp_dev_ctx, &priv->ctx_list, list) { in mlx4_do_bond()
160 if (dev_ctx->intf->flags & MLX4_INTFF_BONDING) { in mlx4_do_bond()
161 list_add_tail(&dev_ctx->bond_list, &bond_list); in mlx4_do_bond()
162 list_del(&dev_ctx->list); in mlx4_do_bond()
167 list_for_each_entry(dev_ctx, &bond_list, bond_list) { in mlx4_do_bond()
168 dev_ctx->intf->remove(dev, dev_ctx->context); in mlx4_do_bond()
169 dev_ctx->context = dev_ctx->intf->add(dev); in mlx4_do_bond()
172 list_add_tail(&dev_ctx->list, &priv->ctx_list); in mlx4_do_bond()
176 dev_ctx->intf->protocol, enable ? in mlx4_do_bond()
186 struct mlx4_device_context *dev_ctx; in mlx4_dispatch_event() local
191 list_for_each_entry(dev_ctx, &priv->ctx_list, list) in mlx4_dispatch_event()
192 if (dev_ctx->intf->event) in mlx4_dispatch_event()
193 dev_ctx->intf->event(dev, dev_ctx->context, type, param); in mlx4_dispatch_event()
251 struct mlx4_device_context *dev_ctx; in mlx4_get_protocol_dev() local
257 list_for_each_entry(dev_ctx, &priv->ctx_list, list) in mlx4_get_protocol_dev()
258 if (dev_ctx->intf->protocol == proto && dev_ctx->intf->get_dev) { in mlx4_get_protocol_dev()
259 result = dev_ctx->intf->get_dev(dev, dev_ctx->context, port); in mlx4_get_protocol_dev()