Lines Matching refs:info
232 struct xencons_info *info;
237 info = vtermno_to_xencons(HVC_COOKIE);
238 if (!info) {
239 info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL);
240 if (!info)
242 } else if (info->intf != NULL) {
255 info->evtchn = v;
261 info->intf = xen_remap(gfn << XEN_PAGE_SHIFT, XEN_PAGE_SIZE);
262 if (info->intf == NULL)
264 info->vtermno = HVC_COOKIE;
267 list_add_tail(&info->list, &xenconsoles);
272 kfree(info);
276 static int xencons_info_pv_init(struct xencons_info *info, int vtermno)
278 info->evtchn = xen_start_info->console.domU.evtchn;
280 info->intf = gfn_to_virt(xen_start_info->console.domU.mfn);
281 info->vtermno = vtermno;
283 list_add_tail(&info->list, &xenconsoles);
290 struct xencons_info *info;
299 info = vtermno_to_xencons(HVC_COOKIE);
300 if (!info) {
301 info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL);
302 if (!info)
304 } else if (info->intf != NULL) {
309 xencons_info_pv_init(info, HVC_COOKIE);
317 struct xencons_info *info;
323 info = vtermno_to_xencons(HVC_COOKIE);
324 if (!info) {
325 info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL);
326 if (!info)
330 info->irq = bind_virq_to_irq(VIRQ_CONSOLE, 0, false);
331 info->vtermno = HVC_COOKIE;
334 list_add_tail(&info->list, &xenconsoles);
340 static void xen_console_update_evtchn(struct xencons_info *info)
348 info->evtchn = v;
350 info->evtchn = xen_start_info->console.domU.evtchn;
355 struct xencons_info *info = vtermno_to_xencons(HVC_COOKIE);
356 if (info != NULL && info->irq) {
358 xen_console_update_evtchn(info);
359 rebind_evtchn_irq(info->evtchn, info->irq);
364 static void xencons_disconnect_backend(struct xencons_info *info)
366 if (info->hvc != NULL)
367 hvc_remove(info->hvc);
368 info->hvc = NULL;
369 if (info->irq > 0) {
370 evtchn_put(info->evtchn);
371 info->irq = 0;
372 info->evtchn = 0;
375 if (info->evtchn > 0)
376 xenbus_free_evtchn(info->xbdev, info->evtchn);
377 info->evtchn = 0;
378 if (info->gntref > 0)
379 gnttab_free_grant_references(info->gntref);
380 info->gntref = 0;
383 static void xencons_free(struct xencons_info *info)
385 free_page((unsigned long)info->intf);
386 info->intf = NULL;
387 info->vtermno = 0;
388 kfree(info);
391 static int xen_console_remove(struct xencons_info *info)
395 xencons_disconnect_backend(info);
397 list_del(&info->list);
399 if (info->xbdev != NULL)
400 xencons_free(info);
403 iounmap(info->intf);
404 kfree(info);
415 struct xencons_info *info)
424 info->evtchn = evtchn;
428 info->irq = irq;
430 info->hvc = hvc_alloc(xenbus_devid_to_vtermno(devid),
432 if (IS_ERR(info->hvc))
433 return PTR_ERR(info->hvc);
437 info->gntref = gref_head;
441 gnttab_grant_foreign_access_ref(ref, info->xbdev->otherend_id,
442 virt_to_gfn(info->intf), 0);
478 struct xencons_info *info;
485 info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL);
486 if (!info)
488 dev_set_drvdata(&dev->dev, info);
489 info->xbdev = dev;
490 info->vtermno = xenbus_devid_to_vtermno(devid);
491 info->intf = (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
492 if (!info->intf)
495 ret = xencons_connect_backend(dev, info);
499 list_add_tail(&info->list, &xenconsoles);
508 xencons_disconnect_backend(info);
509 xencons_free(info);
515 struct xencons_info *info = dev_get_drvdata(&dev->dev);
517 xencons_disconnect_backend(info);
518 memset(info->intf, 0, XEN_PAGE_SIZE);
519 return xencons_connect_backend(dev, info);
545 struct xencons_info *info = dev_get_drvdata(&dev->dev);;
552 if (info->hvc) {
553 hvc_remove(info->hvc);
554 info->hvc = NULL;
581 struct xencons_info *info;
592 info = vtermno_to_xencons(HVC_COOKIE);
602 info = vtermno_to_xencons(HVC_COOKIE);
603 info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn);
605 if (info->irq < 0)
606 info->irq = 0; /* NO_IRQ */
608 irq_set_noprobe(info->irq);
610 info->hvc = hvc_alloc(HVC_COOKIE, info->irq, ops, 256);
611 if (IS_ERR(info->hvc)) {
614 r = PTR_ERR(info->hvc);
616 list_del(&info->list);
618 if (info->irq)
619 evtchn_put(info->evtchn);
620 kfree(info);