Lines Matching full:private
39 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_quiesce() local
58 private->completion = &completion; in vfio_ccw_sch_quiesce()
64 private->completion = NULL; in vfio_ccw_sch_quiesce()
75 struct vfio_ccw_private *private; in vfio_ccw_sch_io_todo() local
80 private = container_of(work, struct vfio_ccw_private, io_work); in vfio_ccw_sch_io_todo()
81 irb = &private->irb; in vfio_ccw_sch_io_todo()
86 cp_update_scsw(&private->cp, &irb->scsw); in vfio_ccw_sch_io_todo()
87 if (is_final && private->state == VFIO_CCW_STATE_CP_PENDING) { in vfio_ccw_sch_io_todo()
88 cp_free(&private->cp); in vfio_ccw_sch_io_todo()
92 mutex_lock(&private->io_mutex); in vfio_ccw_sch_io_todo()
93 memcpy(private->io_region->irb_area, irb, sizeof(*irb)); in vfio_ccw_sch_io_todo()
94 mutex_unlock(&private->io_mutex); in vfio_ccw_sch_io_todo()
103 private->state = VFIO_CCW_STATE_IDLE; in vfio_ccw_sch_io_todo()
105 if (private->io_trigger) in vfio_ccw_sch_io_todo()
106 eventfd_signal(private->io_trigger, 1); in vfio_ccw_sch_io_todo()
111 struct vfio_ccw_private *private; in vfio_ccw_crw_todo() local
113 private = container_of(work, struct vfio_ccw_private, crw_work); in vfio_ccw_crw_todo()
115 if (!list_empty(&private->crw) && private->crw_trigger) in vfio_ccw_crw_todo()
116 eventfd_signal(private->crw_trigger, 1); in vfio_ccw_crw_todo()
124 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_irq() local
127 vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_INTERRUPT); in vfio_ccw_sch_irq()
132 struct vfio_ccw_private *private; in vfio_ccw_alloc_private() local
134 private = kzalloc(sizeof(*private), GFP_KERNEL); in vfio_ccw_alloc_private()
135 if (!private) in vfio_ccw_alloc_private()
138 private->sch = sch; in vfio_ccw_alloc_private()
139 mutex_init(&private->io_mutex); in vfio_ccw_alloc_private()
140 private->state = VFIO_CCW_STATE_STANDBY; in vfio_ccw_alloc_private()
141 INIT_LIST_HEAD(&private->crw); in vfio_ccw_alloc_private()
142 INIT_WORK(&private->io_work, vfio_ccw_sch_io_todo); in vfio_ccw_alloc_private()
143 INIT_WORK(&private->crw_work, vfio_ccw_crw_todo); in vfio_ccw_alloc_private()
145 private->cp.guest_cp = kcalloc(CCWCHAIN_LEN_MAX, sizeof(struct ccw1), in vfio_ccw_alloc_private()
147 if (!private->cp.guest_cp) in vfio_ccw_alloc_private()
150 private->io_region = kmem_cache_zalloc(vfio_ccw_io_region, in vfio_ccw_alloc_private()
152 if (!private->io_region) in vfio_ccw_alloc_private()
155 private->cmd_region = kmem_cache_zalloc(vfio_ccw_cmd_region, in vfio_ccw_alloc_private()
157 if (!private->cmd_region) in vfio_ccw_alloc_private()
160 private->schib_region = kmem_cache_zalloc(vfio_ccw_schib_region, in vfio_ccw_alloc_private()
163 if (!private->schib_region) in vfio_ccw_alloc_private()
166 private->crw_region = kmem_cache_zalloc(vfio_ccw_crw_region, in vfio_ccw_alloc_private()
169 if (!private->crw_region) in vfio_ccw_alloc_private()
171 return private; in vfio_ccw_alloc_private()
174 kmem_cache_free(vfio_ccw_schib_region, private->schib_region); in vfio_ccw_alloc_private()
176 kmem_cache_free(vfio_ccw_cmd_region, private->cmd_region); in vfio_ccw_alloc_private()
178 kmem_cache_free(vfio_ccw_io_region, private->io_region); in vfio_ccw_alloc_private()
180 kfree(private->cp.guest_cp); in vfio_ccw_alloc_private()
182 mutex_destroy(&private->io_mutex); in vfio_ccw_alloc_private()
183 kfree(private); in vfio_ccw_alloc_private()
187 static void vfio_ccw_free_private(struct vfio_ccw_private *private) in vfio_ccw_free_private() argument
191 list_for_each_entry_safe(crw, temp, &private->crw, next) { in vfio_ccw_free_private()
196 kmem_cache_free(vfio_ccw_crw_region, private->crw_region); in vfio_ccw_free_private()
197 kmem_cache_free(vfio_ccw_schib_region, private->schib_region); in vfio_ccw_free_private()
198 kmem_cache_free(vfio_ccw_cmd_region, private->cmd_region); in vfio_ccw_free_private()
199 kmem_cache_free(vfio_ccw_io_region, private->io_region); in vfio_ccw_free_private()
200 kfree(private->cp.guest_cp); in vfio_ccw_free_private()
201 mutex_destroy(&private->io_mutex); in vfio_ccw_free_private()
202 kfree(private); in vfio_ccw_free_private()
207 struct vfio_ccw_private *private; in vfio_ccw_sch_probe() local
216 private = vfio_ccw_alloc_private(sch); in vfio_ccw_sch_probe()
217 if (IS_ERR(private)) in vfio_ccw_sch_probe()
218 return PTR_ERR(private); in vfio_ccw_sch_probe()
220 dev_set_drvdata(&sch->dev, private); in vfio_ccw_sch_probe()
222 private->mdev_type.sysfs_name = "io"; in vfio_ccw_sch_probe()
223 private->mdev_type.pretty_name = "I/O subchannel (Non-QDIO)"; in vfio_ccw_sch_probe()
224 private->mdev_types[0] = &private->mdev_type; in vfio_ccw_sch_probe()
225 ret = mdev_register_parent(&private->parent, &sch->dev, in vfio_ccw_sch_probe()
227 private->mdev_types, 1); in vfio_ccw_sch_probe()
238 vfio_ccw_free_private(private); in vfio_ccw_sch_probe()
244 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_remove() local
246 mdev_unregister_parent(&private->parent); in vfio_ccw_sch_remove()
250 vfio_ccw_free_private(private); in vfio_ccw_sch_remove()
259 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_shutdown() local
261 vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_CLOSE); in vfio_ccw_sch_shutdown()
262 vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER); in vfio_ccw_sch_shutdown()
277 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_event() local
291 vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER); in vfio_ccw_sch_event()
299 static void vfio_ccw_queue_crw(struct vfio_ccw_private *private, in vfio_ccw_queue_crw() argument
322 list_add_tail(&crw->next, &private->crw); in vfio_ccw_queue_crw()
323 queue_work(vfio_ccw_work_q, &private->crw_work); in vfio_ccw_queue_crw()
329 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_chp_event() local
333 if (!private || !mask) in vfio_ccw_chp_event()
336 trace_vfio_ccw_chp_event(private->sch->schid, mask, event); in vfio_ccw_chp_event()
357 vfio_ccw_queue_crw(private, CRW_RSC_CPATH, CRW_ERC_PERRN, in vfio_ccw_chp_event()
368 vfio_ccw_queue_crw(private, CRW_RSC_CPATH, CRW_ERC_INIT, in vfio_ccw_chp_event()