Lines Matching defs:dev_ctx
52 struct mlx4_device_context *dev_ctx;
54 dev_ctx = kmalloc(sizeof *dev_ctx, GFP_KERNEL);
55 if (!dev_ctx)
58 dev_ctx->intf = intf;
59 dev_ctx->context = intf->add(&priv->dev);
61 if (dev_ctx->context) {
63 list_add_tail(&dev_ctx->list, &priv->ctx_list);
67 intf->activate(&priv->dev, dev_ctx->context);
71 kfree(dev_ctx);
76 struct mlx4_device_context *dev_ctx;
78 list_for_each_entry(dev_ctx, &priv->ctx_list, list)
79 if (dev_ctx->intf == intf) {
81 list_del(&dev_ctx->list);
84 intf->remove(&priv->dev, dev_ctx->context);
85 kfree(dev_ctx);
133 struct mlx4_device_context *dev_ctx = NULL, *temp_dev_ctx;
159 list_for_each_entry_safe(dev_ctx, temp_dev_ctx, &priv->ctx_list, list) {
160 if (dev_ctx->intf->flags & MLX4_INTFF_BONDING) {
161 list_add_tail(&dev_ctx->bond_list, &bond_list);
162 list_del(&dev_ctx->list);
167 list_for_each_entry(dev_ctx, &bond_list, bond_list) {
168 dev_ctx->intf->remove(dev, dev_ctx->context);
169 dev_ctx->context = dev_ctx->intf->add(dev);
172 list_add_tail(&dev_ctx->list, &priv->ctx_list);
176 dev_ctx->intf->protocol, enable ?
186 struct mlx4_device_context *dev_ctx;
191 list_for_each_entry(dev_ctx, &priv->ctx_list, list)
192 if (dev_ctx->intf->event)
193 dev_ctx->intf->event(dev, dev_ctx->context, type, param);
239 struct mlx4_device_context *dev_ctx;
245 list_for_each_entry(dev_ctx, &priv->ctx_list, list)
246 if (dev_ctx->intf->protocol == proto && dev_ctx->intf->get_dev) {
247 result = dev_ctx->intf->get_dev(dev, dev_ctx->context, port);