void ibmvscsi_release_crq_queue(struct crq_queue *queue, struct ibmvscsi_host_data *hostdata, int max_requests) { vio_clearHandler(viomajorsubtype_scsi); viopath_close(viopath_hostLp, viomajorsubtype_scsi, max_requests); }
static void __init get_viotape_info(struct device_node *vio_root) { HvLpEvent_Rc hvrc; u32 unit; struct vio_resource *unitinfo; dma_addr_t unitinfo_dmaaddr; size_t len = sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALTAPES; struct vio_waitevent we; int ret; init_completion(&we.com); ret = viopath_open(viopath_hostLp, viomajorsubtype_tape, 2); if (ret) { printk(KERN_WARNING "get_viotape_info: " "error on viopath_open to hostlp %d\n", ret); return; } vio_setHandler(viomajorsubtype_tape, handle_tape_event); unitinfo = iseries_hv_alloc(len, &unitinfo_dmaaddr, GFP_ATOMIC); if (!unitinfo) goto clear_handler; memset(unitinfo, 0, len); hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp, HvLpEvent_Type_VirtualIo, viomajorsubtype_tape | viotapegetinfo, HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck, viopath_sourceinst(viopath_hostLp), viopath_targetinst(viopath_hostLp), (u64)(unsigned long)&we, VIOVERSION << 16, unitinfo_dmaaddr, len, 0, 0); if (hvrc != HvLpEvent_Rc_Good) { printk(KERN_WARNING "get_viotape_info: hv error on op %d\n", (int)hvrc); goto hv_free; } wait_for_completion(&we.com); for (unit = 0; (unit < HVMAXARCHITECTEDVIRTUALTAPES) && unitinfo[unit].rsrcname[0]; unit++) { if (!do_device_node(vio_root, "viotape", FIRST_VIOTAPE + unit, unit, "byte", "IBM,iSeries-viotape", &unitinfo[unit])) break; } hv_free: iseries_hv_free(len, unitinfo, unitinfo_dmaaddr); clear_handler: vio_clearHandler(viomajorsubtype_tape); viopath_close(viopath_hostLp, viomajorsubtype_tape, 2); }
static void __init get_viodasd_info(struct device_node *vio_root) { int rc; u32 unit; rc = viopath_open(viopath_hostLp, viomajorsubtype_blockio, 2); if (rc) { printk(KERN_WARNING "get_viodasd_info: " "error opening path to host partition %d\n", viopath_hostLp); return; } /* Initialize our request handler */ vio_setHandler(viomajorsubtype_blockio, handle_block_event); for (unit = 0; unit < HVMAXARCHITECTEDVIRTUALDISKS; unit++) probe_disk(vio_root, unit); vio_clearHandler(viomajorsubtype_blockio); viopath_close(viopath_hostLp, viomajorsubtype_blockio, 2); }
static void __init get_viocd_info(struct device_node *vio_root) { HvLpEvent_Rc hvrc; u32 unit; struct vio_waitevent we; struct vio_resource *unitinfo; dma_addr_t unitinfo_dmaaddr; int ret; ret = viopath_open(viopath_hostLp, viomajorsubtype_cdio, 2); if (ret) { printk(KERN_WARNING "get_viocd_info: error opening path to host partition %d\n", viopath_hostLp); return; } /* Initialize our request handler */ vio_setHandler(viomajorsubtype_cdio, handle_cd_event); unitinfo = iseries_hv_alloc( sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS, &unitinfo_dmaaddr, GFP_ATOMIC); if (!unitinfo) { printk(KERN_WARNING "get_viocd_info: error allocating unitinfo\n"); goto clear_handler; } memset(unitinfo, 0, sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS); init_completion(&we.com); hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp, HvLpEvent_Type_VirtualIo, viomajorsubtype_cdio | viocdgetinfo, HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck, viopath_sourceinst(viopath_hostLp), viopath_targetinst(viopath_hostLp), (u64)&we, VIOVERSION << 16, unitinfo_dmaaddr, 0, sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS, 0); if (hvrc != HvLpEvent_Rc_Good) { printk(KERN_WARNING "get_viocd_info: cdrom error sending event. rc %d\n", (int)hvrc); goto hv_free; } wait_for_completion(&we.com); if (we.rc) { printk(KERN_WARNING "get_viocd_info: bad rc %d:0x%04X\n", we.rc, we.sub_result); goto hv_free; } for (unit = 0; (unit < HVMAXARCHITECTEDVIRTUALCDROMS) && unitinfo[unit].rsrcname[0]; unit++) { if (!do_device_node(vio_root, "viocd", FIRST_VIOCD + unit, unit, "block", "IBM,iSeries-viocd", &unitinfo[unit])) break; } hv_free: iseries_hv_free(sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS, unitinfo, unitinfo_dmaaddr); clear_handler: vio_clearHandler(viomajorsubtype_cdio); viopath_close(viopath_hostLp, viomajorsubtype_cdio, 2); }